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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
20 // A view on the simulation; this view is a microscopic one
21 /****************************************************************************/
22 #ifndef GUIViewTraffic_h
23 #define GUIViewTraffic_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 #include <utils/geom/Boundary.h>
37 #include <utils/geom/Position.h>
38 #include <utils/common/RGBColor.h>
40 #include "GUISUMOViewParent.h"
42 
43 
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class GUINet;
48 class GUISUMOViewParent;
49 class GUIVehicle;
50 class GUIVideoEncoder;
51 class MSRoute;
52 
53 
54 // ===========================================================================
55 // class definitions
56 // ===========================================================================
62  FXDECLARE(GUIViewTraffic)
63 public:
65  GUIViewTraffic(FXComposite* p, GUIMainWindow& app,
66  GUISUMOViewParent* parent, GUINet& net, FXGLVisual* glVis,
67  FXGLCanvas* share);
69  virtual ~GUIViewTraffic();
70 
72  virtual void buildViewToolBars(GUIGlChildWindow&);
73 
74 
78  void startTrack(int id);
79 
80 
83  void stopTrack();
84 
85 
89  GUIGlID getTrackedID() const;
90 
91  bool setColorScheme(const std::string& name);
92 
94  void buildColorRainbow(GUIColorScheme& scheme, int active, GUIGlObjectType objectType);
95 
97  void onGamingClick(Position pos);
98 
101 
103  long onCmdCloseLane(FXObject*, FXSelector, void*);
104  long onCmdCloseEdge(FXObject*, FXSelector, void*);
105  long onCmdAddRerouter(FXObject*, FXSelector, void*);
106 
109  void saveFrame(const std::string& destFile, FXColor* buf);
110 
113  void endSnapshot();
114 
117  void checkSnapshots();
118 
119 protected:
120  int doPaintGL(int mode, const Boundary& bound);
121 
123 
124 private:
126 
127 #ifdef HAVE_FFMPEG
128  GUIVideoEncoder* myCurrentVideo;
129 #endif
130 
131 protected:
133 
134 };
135 
136 
137 #endif
138 
139 /****************************************************************************/
140 
virtual void buildViewToolBars(GUIGlChildWindow &)
builds the view toolbars
long onCmdCloseLane(FXObject *, FXSelector, void *)
interaction with the simulation
bool setColorScheme(const std::string &name)
set color scheme
GUIGlObjectType
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:47
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:69
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
long onCmdAddRerouter(FXObject *, FXSelector, void *)
long onCmdCloseEdge(FXObject *, FXSelector, void *)
void onGamingClick(Position pos)
handle mouse click in gaming mode
void startTrack(int id)
Starts vehicle tracking.
void checkSnapshots()
Checks whether it is time for a snapshot.
void buildColorRainbow(GUIColorScheme &scheme, int active, GUIGlObjectType objectType)
recalibrate color scheme according to the current value range
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:49
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:88
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
long long int SUMOTime
Definition: TraCIDefs.h:51
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:60