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-2013 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 getOccupancy() 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