SUMO - Simulation of Urban MObility
GUIViewTraffic.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // A view on the simulation; this view is a microscopic one
19 /****************************************************************************/
20 #ifndef GUIViewTraffic_h
21 #define GUIViewTraffic_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <string>
30 #include <utils/geom/Boundary.h>
31 #include <utils/geom/Position.h>
32 #include <utils/common/RGBColor.h>
34 #include "GUISUMOViewParent.h"
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class GUINet;
42 class GUISUMOViewParent;
43 class GUIVehicle;
44 class GUIVideoEncoder;
45 class MSRoute;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
56  FXDECLARE(GUIViewTraffic)
57 public:
59  GUIViewTraffic(FXComposite* p, GUIMainWindow& app,
60  GUISUMOViewParent* parent, GUINet& net, FXGLVisual* glVis,
61  FXGLCanvas* share);
63  virtual ~GUIViewTraffic();
64 
66  virtual void buildViewToolBars(GUIGlChildWindow&);
67 
68 
72  void startTrack(int id);
73 
74 
77  void stopTrack();
78 
79 
83  GUIGlID getTrackedID() const;
84 
85  bool setColorScheme(const std::string& name);
86 
88  void buildColorRainbow(const GUIVisualizationSettings& s, GUIColorScheme& scheme, int active, GUIGlObjectType objectType);
89 
91  void onGamingClick(Position pos);
92 
95 
97  long onCmdCloseLane(FXObject*, FXSelector, void*);
98  long onCmdCloseEdge(FXObject*, FXSelector, void*);
99  long onCmdAddRerouter(FXObject*, FXSelector, void*);
100 
101  long onDoubleClicked(FXObject*, FXSelector, void*);
102 
105  void saveFrame(const std::string& destFile, FXColor* buf);
106 
109  void endSnapshot();
110 
113  void checkSnapshots();
114 
116  const std::vector<SUMOTime> retrieveBreakpoints() const;
117 
118 protected:
119  int doPaintGL(int mode, const Boundary& bound);
120 
122 
123 private:
125 
126 #ifdef HAVE_FFMPEG
127  GUIVideoEncoder* myCurrentVideo;
128 #endif
129 
130 protected:
132 
133 };
134 
135 
136 #endif
137 
138 /****************************************************************************/
139 
virtual void buildViewToolBars(GUIGlChildWindow &)
builds the view toolbars
long onCmdCloseLane(FXObject *, FXSelector, void *)
interaction with the simulation
long long int SUMOTime
Definition: SUMOTime.h:36
void buildColorRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, int active, GUIGlObjectType objectType)
recalibrate color scheme according to the current value range
bool setColorScheme(const std::string &name)
set color scheme
GUIGlObjectType
Stores the information about how to visualize structures.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:63
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
long onCmdAddRerouter(FXObject *, FXSelector, void *)
long onCmdCloseEdge(FXObject *, FXSelector, void *)
void onGamingClick(Position pos)
handle mouse click in gaming mode
A simple video encoder from RGBA pics to anything ffmpeg can handle.
void startTrack(int id)
Starts vehicle tracking.
long onDoubleClicked(FXObject *, FXSelector, void *)
void checkSnapshots()
Checks whether it is time for a snapshot.
SUMOTime getCurrentTimeStep() const
get the current simulation time
A single child window which contains a view of the simulation area.
void endSnapshot()
Ends a video snapshot.
unsigned int GUIGlID
Definition: GUIGlObject.h:43
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:82
void saveFrame(const std::string &destFile, FXColor *buf)
Adds a frame to a video snapshot which will be initialized if neccessary.
virtual ~GUIViewTraffic()
destructor
int doPaintGL(int mode, const Boundary &bound)
paint GL
const std::vector< SUMOTime > retrieveBreakpoints() const
retrieve breakpoints from the current runThread
GUIGlID getTrackedID() const
Returns the id of the tracked vehicle (-1 if none)
void stopTrack()
Stops vehicle tracking.
GUILane * getLaneUnderCursor()
A MSVehicle extended by some values for usage within the gui.
Definition: GUIVehicle.h:54