SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUILaneWrapper.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // A MSLane extended for visualisation purposes.
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUILaneWrapper_h
23 #define GUILaneWrapper_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 #include <utility>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class GUINet;
47 class MSLane;
48 class MSEdge;
49 class PositionVector;
50 
51 
52 // ===========================================================================
53 // class definitions
54 // ===========================================================================
64 class GUILaneWrapper : public GUIGlObject {
65 public:
70  GUILaneWrapper(MSLane& lane, const PositionVector& shape, unsigned int index);
71 
72 
74  virtual ~GUILaneWrapper();
75 
76 
77 
79 
80 
89  GUISUMOAbstractView& parent);
90 
91 
100  GUISUMOAbstractView& parent);
101 
102 
109 
110 
115  void drawGL(const GUIVisualizationSettings& s) const;
117 
118 
119 
123  const MSLane& getLane() const {
124  return myLane;
125  }
126 
127 
128  const PositionVector& getShape() const;
129  const std::vector<SUMOReal>& getShapeRotations() const;
130  const std::vector<SUMOReal>& getShapeLengths() const;
131 
132  SUMOReal firstWaitingTime() const;
133 
134 
136  bool forLane(const MSLane& lane) const;
137 
138 
140  void drawMarkings(const GUIVisualizationSettings& s) const;
141 
143  void drawCrossties(const GUIVisualizationSettings& s) const;
144 
146  unsigned int getLinkNumber() const;
147 
149  return myHalfLaneWidth;
150  }
151 
152 
154 
155 
160 
161 
166 
167 
172 
173 
178 
179 
184 
185 
191 
192 
193  SUMOReal getEdgeLaneNumber() const;
194 
198 
199 protected:
202 
205 
207  std::vector<SUMOReal> myShapeRotations;
208 
210  std::vector<SUMOReal> myShapeLengths;
211 
214 
217 
220 
222  unsigned int myIndex;
223 
224 private:
227 
230 
232  void ROWdrawAction_drawLinkNo() const;
233  void ROWdrawAction_drawTLSLinkNo(const GUINet& net) const;
234  void ROWdrawAction_drawLinkRules(const GUINet& net) const;
235  void ROWdrawAction_drawArrows() const;
237 
239  void setColor(const GUIVisualizationSettings& s) const;
240 
242  SUMOReal getColorValue(size_t activeScheme) const;
243 
244 };
245 
246 
247 #endif
248 
249 /****************************************************************************/
250