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 
142 
144  unsigned int getLinkNumber() const;
145 
147  return myHalfLaneWidth;
148  }
149 
150 
152 
153 
158 
159 
164 
165 
170 
171 
176 
177 
182 
183 
189 
190 
191  SUMOReal getEdgeLaneNumber() const;
192 
193 
194 protected:
197 
200 
202  std::vector<SUMOReal> myShapeRotations;
203 
205  std::vector<SUMOReal> myShapeLengths;
206 
209 
212 
215 
217  unsigned int myIndex;
218 
219 private:
222 
225 
227  void ROWdrawAction_drawLinkNo() const;
228  void ROWdrawAction_drawTLSLinkNo(const GUINet& net) const;
229  void ROWdrawAction_drawLinkRules(const GUINet& net) const;
230  void ROWdrawAction_drawArrows() const;
232 
234  void setColor(const GUIVisualizationSettings& s) const;
235 
237  SUMOReal getColorValue(size_t activeScheme) const;
238 
239 };
240 
241 
242 #endif
243 
244 /****************************************************************************/
245