SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIEdge.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // A road/street connecting two junctions (gui-version)
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2014 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 GUIEdge_h
24 #define GUIEdge_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 <vector>
37 #include <string>
38 #include <microsim/MSEdge.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 #ifdef HAVE_INTERNAL
47 class MESegment;
48 #endif
49 class MSBaseVehicle;
50 
51 
52 // ===========================================================================
53 // class definitions
54 // ===========================================================================
61 class GUIEdge : public MSEdge, public GUIGlObject {
62 public:
68  GUIEdge(const std::string& id, int numericalID,
69  const EdgeBasicFunction function,
70  const std::string& streetName, const std::string& edgeType, int priority);
71 
72 
74  ~GUIEdge();
75 
76 
77  /* @brief Returns the gl-ids of all known edges
78  * @param[in] includeInternal Whether to include ids of internal edges
79  */
80  static std::vector<GUIGlID> getIDs(bool includeInternal);
81 
83  Boundary getBoundary() const;
84 
86  MSLane& getLane(size_t laneNo);
87 
88 
89 
93  static std::pair<SUMOReal, SUMOReal> getLaneOffsets(SUMOReal x1, SUMOReal y1,
94  SUMOReal x2, SUMOReal y2, SUMOReal prev, SUMOReal wanted);
95 
96  static void fill(std::vector<GUIEdge*>& netsWrappers);
97 
98 
99 
101 
102 
111  GUISUMOAbstractView& parent);
112 
113 
122  GUISUMOAbstractView& parent);
123 
124 
131 
132 
137  void drawGL(const GUIVisualizationSettings& s) const;
139 
140 
141  void addPerson(MSPerson* p) const {
144  }
145 
146  void removePerson(MSPerson* p) const {
149  }
150 
151 
152 #ifdef HAVE_INTERNAL
153  unsigned int getVehicleNo() const;
154  std::string getVehicleIDs() const;
155  SUMOReal getBruttoOccupancy() const;
156  SUMOReal getMeanSpeed() const;
157  SUMOReal getAllowedSpeed() const;
159  SUMOReal getFlow() const;
161  SUMOReal getRelativeSpeed() const;
162 
164  void setColor(const GUIVisualizationSettings& s) const;
165 
167  SUMOReal getColorValue(size_t activeScheme) const;
168 
170  SUMOReal getScaleValue(size_t activeScheme) const;
171 
173  MESegment* getSegmentAtPosition(const Position& pos);
174 
176  void setVehicleColor(const GUIVisualizationSettings& s, MSBaseVehicle* veh) const;
177 
179  SUMOReal getVehicleColorValue(size_t activeScheme, MSBaseVehicle* veh) const;
180 
181  void drawMesoVehicles(const GUIVisualizationSettings& s) const;
182 
183 #endif
184 
185 
186 private:
188  GUIEdge(const GUIEdge& s);
189 
191  GUIEdge& operator=(const GUIEdge& s);
192 
193 
194 private:
196  mutable MFXMutex myLock;
197 
198 };
199 
200 
201 #endif
202 
203 /****************************************************************************/
204 
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIEdge.cpp:191
static std::pair< SUMOReal, SUMOReal > getLaneOffsets(SUMOReal x1, SUMOReal y1, SUMOReal x2, SUMOReal y2, SUMOReal prev, SUMOReal wanted)
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIEdge.cpp:138
Stores the information about how to visualize structures.
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:52
EdgeBasicFunction
Defines possible edge types.
Definition: MSEdge.h:84
void removePerson(MSPerson *p) const
Definition: GUIEdge.h:146
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:61
A road/street connecting two junctions.
Definition: MSEdge.h:75
~GUIEdge()
Destructor.
Definition: GUIEdge.cpp:83
GUIEdge & operator=(const GUIEdge &s)
invalidated assignment operator
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
virtual GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIEdge.cpp:155
virtual void removePerson(MSPerson *p) const
Definition: MSEdge.h:539
MSLane & getLane(size_t laneNo)
returns the enumerated lane (!!! why not private with a friend?)
Definition: GUIEdge.cpp:92
virtual void addPerson(MSPerson *p) const
Definition: MSEdge.h:535
GUIEdge(const std::string &id, int numericalID, const EdgeBasicFunction function, const std::string &streetName, const std::string &edgeType, int priority)
Constructor.
Definition: GUIEdge.cpp:76
static std::vector< GUIGlID > getIDs(bool includeInternal)
Definition: GUIEdge.cpp:99
MFXMutex myLock
The mutex used to avoid concurrent updates of myPersons.
Definition: GUIEdge.h:196
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
Definition: AbstractMutex.h:71
The popup menu of a globject.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIEdge.cpp:199
#define SUMOReal
Definition: config.h:218
Boundary getBoundary() const
Returns the street&#39;s geometry.
Definition: GUIEdge.cpp:114
void addPerson(MSPerson *p) const
Definition: GUIEdge.h:141
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
A window containing a gl-object&#39;s parameter.
static void fill(std::vector< GUIEdge * > &netsWrappers)
Definition: GUIEdge.cpp:125