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-2016 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 <utils/shapes/Polygon.h>
42 #include "GUISUMOViewParent.h"
44 
45 
46 // ===========================================================================
47 // class declarations
48 // ===========================================================================
49 class GUINet;
50 class GUISUMOViewParent;
51 class GUIVehicle;
52 class GUIVideoEncoder;
53 class MSRoute;
54 
55 
56 // ===========================================================================
57 // class definitions
58 // ===========================================================================
64  FXDECLARE(GUIViewTraffic)
65 public:
67  GUIViewTraffic(FXComposite* p, GUIMainWindow& app,
68  GUISUMOViewParent* parent, GUINet& net, FXGLVisual* glVis,
69  FXGLCanvas* share);
71  virtual ~GUIViewTraffic();
72 
74  virtual void buildViewToolBars(GUIGlChildWindow&);
75 
76 
80  void startTrack(int id);
81 
82 
85  void stopTrack();
86 
87 
91  GUIGlID getTrackedID() const;
92 
93  bool setColorScheme(const std::string& name);
94 
96  void onGamingClick(Position pos);
97 
100 
102  long onCmdCloseLane(FXObject*, FXSelector, void*);
103  long onCmdCloseEdge(FXObject*, FXSelector, void*);
104  long onCmdAddRerouter(FXObject*, FXSelector, void*);
105 
108  void saveFrame(const std::string& destFile, FXColor* buf);
109 
112  void endSnapshot();
113 
116  void checkSnapshots();
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:43
bool setColorScheme(const std::string &name)
set color scheme
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.
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
void stopTrack()
Stops vehicle tracking.
GUILane * getLaneUnderCursor()
A MSVehicle extended by some values for usage within the gui.
Definition: GUIVehicle.h:61