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-2013 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 #ifdef HAVE_OSG
51 namespace osg {
52 class Geometry;
53 }
54 #endif
55 
56 
57 // ===========================================================================
58 // class definitions
59 // ===========================================================================
69 class GUILaneWrapper : public GUIGlObject {
70 public:
75  GUILaneWrapper(MSLane& lane, const PositionVector& shape, unsigned int index);
76 
77 
79  virtual ~GUILaneWrapper();
80 
81 
82 
84 
85 
94  GUISUMOAbstractView& parent);
95 
96 
105  GUISUMOAbstractView& parent);
106 
107 
114 
115 
120  void drawGL(const GUIVisualizationSettings& s) const;
122 
123 
124 
128  const MSLane& getLane() const {
129  return myLane;
130  }
131 
132 
133  const PositionVector& getShape() const;
134  const std::vector<SUMOReal>& getShapeRotations() const;
135  const std::vector<SUMOReal>& getShapeLengths() const;
136 
137  SUMOReal firstWaitingTime() const;
138 
139 
141  bool forLane(const MSLane& lane) const;
142 
143 
145  void drawMarkings(const GUIVisualizationSettings& s) const;
146 
148  void drawCrossties(const GUIVisualizationSettings& s) const;
149 
151  unsigned int getLinkNumber() const;
152 
154  return myHalfLaneWidth;
155  }
156 
157 
159 
160 
165 
166 
171 
172 
177 
178 
183 
184 
189 
190 
196 
197 
198  SUMOReal getEdgeLaneNumber() const;
199 
203 
204 #ifdef HAVE_OSG
205  void setGeometry(osg::Geometry* geom) {
206  myGeom = geom;
207  }
208 
209  void updateColor(const GUIVisualizationSettings& s);
210 #endif
211 
212 private:
214  void drawLinkNo() const;
215  void drawTLSLinkNo(const GUINet& net) const;
216  void drawLinkRules(const GUINet& net) const;
217  void drawArrows() const;
218  void drawLane2LaneConnections() const;
219 
221  SUMOReal getColorValue(size_t activeScheme) const;
222 
224  void setColor(const GUIVisualizationSettings& s) const;
225 
226 private:
229 
232 
234  std::vector<SUMOReal> myShapeRotations;
235 
237  std::vector<SUMOReal> myShapeLengths;
238 
241 
244 
246  unsigned int myIndex;
247 
248 #ifdef HAVE_OSG
249  osg::Geometry* myGeom;
250 #endif
251 
252 private:
255 
258 };
259 
260 
261 #endif
262 
263 /****************************************************************************/
264