SUMO - Simulation of Urban MObility
GUIContainer.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A MSVehicle extended by some values for usage within the gui
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef GUIContainer_h
22 #define GUIContainer_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
35 #include <set>
36 #include <string>
38 #include <utils/common/RGBColor.h>
39 #include <microsim/MSContainer.h>
43 
44 
45 // ===========================================================================
46 // class declarations
47 // ===========================================================================
50 class MSDevice_Vehroutes;
51 
52 
53 // ===========================================================================
54 // class definitions
55 // ===========================================================================
59 class GUIContainer : public MSContainer, public GUIGlObject {
60 public:
64 
65 
67  ~GUIContainer();
68 
69 
71 
72 
81 
82 
91 
92 
99 
100 
105  void drawGL(const GUIVisualizationSettings& s) const;
106 
107 
108 
113  virtual void drawGLAdditional(GUISUMOAbstractView* const parent, const GUIVisualizationSettings& s) const;
115 
116  /* @brief set the position of a container while being transported by a vehicle
117  * @note This must be called by the vehicle before the call to drawGl */
118  void setPositionInVehicle(const Position& pos) {
119  myPositionInVehicle = pos;
120  }
121 
123 
124 
126  double getEdgePos() const;
127 
129  // @note overrides the base method and returns myPositionInVehicle while in driving stage
130  Position getPosition() const;
131 
133  double getAngle() const;
134 
136  double getWaitingSeconds() const;
137 
139  double getSpeed() const;
140 
142 
143 
151  //FXDECLARE(GUIContainerPopupMenu)
152  public:
160  GUISUMOAbstractView& parent, GUIGlObject& o, std::map<GUISUMOAbstractView*, int>& additionalVisualizations);
161 
164 
165 
166  protected:
168  std::map<GUISUMOAbstractView*, int>& myVehiclesAdditionalVisualizations;
170  std::map<GUISUMOAbstractView*, int> dummy;
171 
172  protected:
174  GUIContainerPopupMenu() : myVehiclesAdditionalVisualizations(dummy) { }
175 
176  };
177 
178 
179 
181  std::map<GUISUMOAbstractView*, int> myAdditionalVisualizations;
182 
183 
184 
185 
186 private:
188  mutable MFXMutex myLock;
189 
192 
194  void setColor(const GUIVisualizationSettings& s) const;
195 
197  double getColorValue(int activeScheme) const;
198 
200  bool setFunctionalColor(int activeScheme) const;
201 
204  void drawAction_drawAsPoly(const GUIVisualizationSettings& s) const;
207 };
208 
209 
210 #endif
211 
212 /****************************************************************************/
213 
double getAngle() const
return the current angle of the container
double getWaitingSeconds() const
the time this container spent waiting in seconds
std::map< GUISUMOAbstractView *, int > dummy
Needed for parameterless instantiation.
Definition: GUIContainer.h:170
std::map< GUISUMOAbstractView *, int > & myVehiclesAdditionalVisualizations
Information which additional visualisations are enabled (per view)
Definition: GUIContainer.h:168
GUIContainerPopupMenu()
default constructor needed by FOX
Definition: GUIContainer.h:174
Stores the information about how to visualize structures.
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIContainer.h:188
double getEdgePos() const
return the offset from the start of the current edge
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
void drawAction_drawAsImage(const GUIVisualizationSettings &s) const
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
The car-following model and parameter.
Definition: MSVehicleType.h:74
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
Definition: GUIContainer.h:181
GUIContainer(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan)
Constructor.
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Position getPosition() const
return the Network coordinate of the container
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some vehicle function
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void setPositionInVehicle(const Position &pos)
Definition: GUIContainer.h:118
Structure representing possible vehicle parameter.
Position myPositionInVehicle
The position of a container while riding a vehicle.
Definition: GUIContainer.h:191
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
The popup menu of a globject.
void drawAction_drawAsPoly(const GUIVisualizationSettings &s) const
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
double getColorValue(int activeScheme) const
gets the color value according to the current scheme index
~GUIContainer()
destructor
A window containing a gl-object&#39;s parameter.
double getSpeed() const
the current speed of the container