SUMO - Simulation of Urban MObility
GUIViewTraffic.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // A view on the simulation; this view is a microscopic one
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef GUIViewTraffic_h
24 #define GUIViewTraffic_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <utils/geom/Boundary.h>
38 #include <utils/geom/Position.h>
39 #include <utils/common/RGBColor.h>
41 #include "GUISUMOViewParent.h"
43 
44 
45 // ===========================================================================
46 // class declarations
47 // ===========================================================================
48 class GUINet;
49 class GUISUMOViewParent;
50 class GUIVehicle;
51 class GUIVideoEncoder;
52 class MSRoute;
53 
54 
55 // ===========================================================================
56 // class definitions
57 // ===========================================================================
63  FXDECLARE(GUIViewTraffic)
64 public:
66  GUIViewTraffic(FXComposite* p, GUIMainWindow& app,
67  GUISUMOViewParent* parent, GUINet& net, FXGLVisual* glVis,
68  FXGLCanvas* share);
70  virtual ~GUIViewTraffic();
71 
73  virtual void buildViewToolBars(GUIGlChildWindow&);
74 
75 
79  void startTrack(int id);
80 
81 
84  void stopTrack();
85 
86 
90  GUIGlID getTrackedID() const;
91 
92  bool setColorScheme(const std::string& name);
93 
95  void buildColorRainbow(GUIColorScheme& scheme, int active, GUIGlObjectType objectType);
96 
98  void onGamingClick(Position pos);
99 
102 
104  long onCmdCloseLane(FXObject*, FXSelector, void*);
105  long onCmdCloseEdge(FXObject*, FXSelector, void*);
106  long onCmdAddRerouter(FXObject*, FXSelector, void*);
107 
110  void saveFrame(const std::string& destFile, FXColor* buf);
111 
114  void endSnapshot();
115 
118  void checkSnapshots();
119 
120 protected:
121  int doPaintGL(int mode, const Boundary& bound);
122 
124 
125 private:
127 
128 #ifdef HAVE_FFMPEG
129  GUIVideoEncoder* myCurrentVideo;
130 #endif
131 
132 protected:
134 
135 };
136 
137 
138 #endif
139 
140 /****************************************************************************/
141 
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
GUIGlID getTrackedID() const
Returns the id of the tracked vehicle (-1 if none)
SUMOTime getCurrentTimeStep() const
get the current simulation time
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:70
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
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
A single child window which contains a view of the simulation area.
void endSnapshot()
Ends a video snapshot.
unsigned int GUIGlID
Definition: GUIGlObject.h:50
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:89
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:52
void stopTrack()
Stops vehicle tracking.
GUILane * getLaneUnderCursor()
A MSVehicle extended by some values for usage within the gui.
Definition: GUIVehicle.h:61