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-sim.org/
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, const std::string& streetName);
70 
71 
73  ~GUIEdge();
74 
75 
76  /* @brief Returns the gl-ids of all known edges
77  * @param[in] includeInternal Whether to include ids of internal edges
78  */
79  static std::vector<GUIGlID> getIDs(bool includeInternal);
80 
82  Boundary getBoundary() const;
83 
85  MSLane& getLane(size_t laneNo);
86 
87 
88 
92  static std::pair<SUMOReal, SUMOReal> getLaneOffsets(SUMOReal x1, SUMOReal y1,
93  SUMOReal x2, SUMOReal y2, SUMOReal prev, SUMOReal wanted);
94 
95  static void fill(std::vector<GUIEdge*>& netsWrappers);
96 
97 
98 
100 
101 
110  GUISUMOAbstractView& parent);
111 
112 
121  GUISUMOAbstractView& parent);
122 
123 
130 
131 
136  void drawGL(const GUIVisualizationSettings& s) const;
138 
139 
140  void addPerson(MSPerson* p) {
143  }
144 
148  }
149 
150 
151 #ifdef HAVE_INTERNAL
152  unsigned int getVehicleNo() const;
153  std::string getVehicleIDs() const;
154  SUMOReal getBruttoOccupancy() const;
155  SUMOReal getMeanSpeed() const;
156  SUMOReal getAllowedSpeed() const;
158  SUMOReal getFlow() const;
160  SUMOReal getRelativeSpeed() const;
161 
163  void setColor(const GUIVisualizationSettings& s) const;
164 
166  SUMOReal getColorValue(size_t activeScheme) const;
167 
169  MESegment* getSegmentAtPosition(const Position& pos);
170 
172  void setVehicleColor(const GUIVisualizationSettings& s, MSBaseVehicle* veh) const;
173 
174 #endif
175 
176 
177 private:
179  GUIEdge(const GUIEdge& s);
180 
182  GUIEdge& operator=(const GUIEdge& s);
183 
184 
185 private:
187  mutable MFXMutex myLock;
188 
189 };
190 
191 
192 #endif
193 
194 /****************************************************************************/
195 
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIEdge.cpp:189
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:136
Stores the information about how to visualize structures.
GUIEdge(const std::string &id, int numericalID, const EdgeBasicFunction function, const std::string &streetName)
Constructor.
Definition: GUIEdge.cpp:75
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:57
EdgeBasicFunction
Defines possible edge types.
Definition: MSEdge.h:82
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:73
~GUIEdge()
Destructor.
Definition: GUIEdge.cpp:81
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:153
void addPerson(MSPerson *p)
Definition: GUIEdge.h:140
virtual void removePerson(MSPerson *p) const
Definition: MSEdge.h:441
MSLane & getLane(size_t laneNo)
returns the enumerated lane (!!! why not private with a friend?)
Definition: GUIEdge.cpp:90
virtual void addPerson(MSPerson *p) const
Definition: MSEdge.h:437
static std::vector< GUIGlID > getIDs(bool includeInternal)
Definition: GUIEdge.cpp:97
MFXMutex myLock
The mutex used to avoid concurrent updates of myPersons.
Definition: GUIEdge.h:187
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:197
#define SUMOReal
Definition: config.h:215
Boundary getBoundary() const
Returns the street's geometry.
Definition: GUIEdge.cpp:112
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
A window containing a gl-object's parameter.
void removePerson(MSPerson *p)
Definition: GUIEdge.h:145
static void fill(std::vector< GUIEdge * > &netsWrappers)
Definition: GUIEdge.cpp:123