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 
195 
196 
197 
202 
203 
208 
209 
214 
215 
220 
221 
226 
227 
233 
234 
235  SUMOReal getEdgeLaneNumber() const;
236 
240 
241 #ifdef HAVE_OSG
242  void setGeometry(osg::Geometry* geom) {
243  myGeom = geom;
244  }
245 
246  void updateColor(const GUIVisualizationSettings& s);
247 #endif
248 
249 private:
251  void drawLinkNo() const;
252  void drawTLSLinkNo(const GUINet& net) const;
253  void drawLinkRules(const GUINet& net) const;
254  void drawArrows() const;
255  void drawLane2LaneConnections() const;
256 
258  SUMOReal getColorValue(size_t activeScheme) const;
259 
261  void setColor(const GUIVisualizationSettings& s) const;
262 
263 private:
266 
269 
271  std::vector<SUMOReal> myShapeRotations;
272 
274  std::vector<SUMOReal> myShapeLengths;
275 
278 
281 
283  unsigned int myIndex;
284 
285 #ifdef HAVE_OSG
286  osg::Geometry* myGeom;
287 #endif
288 
289 private:
292 
295 };
296 
297 
298 #endif
299 
300 /****************************************************************************/
301 
GUILaneWrapper & operator=(const GUILaneWrapper &)
Invalidated assignment operator.
SUMOReal myHalfLaneWidth
Half of lane width, for speed-up.
SUMOReal getNormedHBEFA_CO2Emissions() const
Returns the sum of last step CO2 emissions normed by the lane&#39;s length.
void drawLinkRules(const GUINet &net) const
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Stores the information about how to visualize structures.
MSLane & myLane
The assigned lane.
GUILaneWrapper(MSLane &lane, const PositionVector &shape, unsigned int index)
Constructor.
unsigned int myIndex
The lane index.
SUMOReal getNormedHBEFA_HCEmissions() const
Returns the sum of last step HC emissions normed by the lane&#39;s length.
SUMOReal getNormedPHEMlight_NOxEmissions() const
Returns the sum of last step NOx emissions normed by the lane&#39;s length.
bool forLane(const MSLane &lane) const
Returns true if the given lane id the lane this wrapper wraps the geometry of.
SUMOReal getNormedPHEMlight_CO2Emissions() const
Returns the sum of last step CO2 emissions normed by the lane&#39;s length.
SUMOReal getNormedPHEMlight_PMxEmissions() const
Returns the sum of last step PMx emissions normed by the lane&#39;s length.
SUMOReal getEdgeLaneNumber() const
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
SUMOReal getNormedHBEFA_NOxEmissions() const
Returns the sum of last step NOx emissions normed by the lane&#39;s length.
const MSLane & getLane() const
Returns the represented lane.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
SUMOReal getNormedHBEFA_PMxEmissions() const
Returns the sum of last step PMx emissions normed by the lane&#39;s length.
const PositionVector & myShape
The shape of the lane.
virtual ~GUILaneWrapper()
Destructor.
A road/street connecting two junctions.
Definition: MSEdge.h:73
unsigned int getLinkNumber() const
Returns the number of links.
SUMOReal getNormedPHEMlight_FuelConsumption() const
Returns the sum of last step fuel comsumption normed by the lane&#39;s length.
void drawCrossties(const GUIVisualizationSettings &s) const
draw crossties for railroads
SUMOReal getColorValue(size_t activeScheme) const
gets the color value according to the current scheme index
SUMOReal myQuarterLaneWidth
Quarter of lane width, for speed-up.
void drawLinkNo() const
helper methods
SUMOReal getNormedPHEMlight_HCEmissions() const
Returns the sum of last step HC emissions normed by the lane&#39;s length.
A list of positions.
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
void drawLane2LaneConnections() const
SUMOReal getNormedHBEFA_FuelConsumption() const
Returns the sum of last step fuel comsumption normed by the lane&#39;s length.
void drawTLSLinkNo(const GUINet &net) const
SUMOReal firstWaitingTime() const
std::vector< SUMOReal > myShapeRotations
The rotations of the shape parts.
const std::vector< SUMOReal > & getShapeRotations() const
void drawMarkings(const GUIVisualizationSettings &s) const
draw lane borders and white markings
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:90
A MSLane extended for visualisation purposes.
The popup menu of a globject.
const std::vector< SUMOReal > & getShapeLengths() const
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
#define SUMOReal
Definition: config.h:215
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
SUMOReal getNormedPHEMlight_COEmissions() const
Returns the sum of last step CO emissions normed by the lane&#39;s length.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
const PositionVector & getShape() const
A window containing a gl-object&#39;s parameter.
void drawArrows() const
SUMOReal getHalfWidth() const
SUMOReal getNormedHBEFA_COEmissions() const
Returns the sum of last step CO emissions normed by the lane&#39;s length.
SUMOReal getStoredEdgeTravelTime() const
Returns the stored traveltime for the edge of this lane.