Eclipse SUMO - Simulation of Urban MObility
GUIJunctionWrapper.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Holds geometrical values for a junction
17 /****************************************************************************/
18 #ifndef GUIJunctionWrapper_h
19 #define GUIJunctionWrapper_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <utility>
32 
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class MSNet;
38 class MSJunction;
39 #ifdef HAVE_OSG
40 namespace osg {
41 class Geometry;
42 }
43 #endif
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
61 public:
65  GUIJunctionWrapper(MSJunction& junction, const std::string& tllID);
66 
67 
69  virtual ~GUIJunctionWrapper();
70 
71 
72 
74 
75 
84  GUISUMOAbstractView& parent);
85 
86 
95  GUIMainWindow& app, GUISUMOAbstractView& parent);
96 
97 
104 
106  const std::string getOptionalName() const;
107 
112  void drawGL(const GUIVisualizationSettings& s) const;
114 
119  return myBoundary;
120  }
121 
123  bool isInternal() const {
124  return myIsInternal;
125  }
126 
130  const MSJunction& getJunction() const {
131  return myJunction;
132  }
133 
134 
135 #ifdef HAVE_OSG
136  void setGeometry(osg::Geometry* geom) {
137  myGeom = geom;
138  }
139 
140  void updateColor(const GUIVisualizationSettings& s);
141 #endif
142 
143 private:
144  double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const;
145 
146 private:
149 
151  double myMaxSize;
152 
155 
158 
163 
165  const std::string myTLLID;
166 
167 #ifdef HAVE_OSG
168  osg::Geometry* myGeom;
169 #endif
170 
171 
172 private:
175 
178 
179 };
180 
181 
182 #endif
183 
184 /****************************************************************************/
185 
GUIGlObject.h
GUIParameterTableWindow
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:62
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:72
MSJunction
The base class for an intersection.
Definition: MSJunction.h:60
GUIJunctionWrapper::getBoundary
Boundary getBoundary() const
Returns the boundary of the junction.
Definition: GUIJunctionWrapper.h:118
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
GUIGLObjectPopupMenu.h
GUIJunctionWrapper::myIsInternal
bool myIsInternal
whether this wraps an instance of MSInternalJunction
Definition: GUIJunctionWrapper.h:157
GUIJunctionWrapper::GUIJunctionWrapper
GUIJunctionWrapper(MSJunction &junction, const std::string &tllID)
Constructor.
Definition: GUIJunctionWrapper.cpp:57
GUIJunctionWrapper::isInternal
bool isInternal() const
whether this is an inner junction (a waiting spot for crossing a "real" junction)
Definition: GUIJunctionWrapper.h:123
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:47
GUIJunctionWrapper::myAmWaterway
bool myAmWaterway
whether this junction has only waterways as incoming and outgoing edges
Definition: GUIJunctionWrapper.h:160
GUIJunctionWrapper::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIJunctionWrapper.cpp:98
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GUIJunctionWrapper::getColorValue
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
Definition: GUIJunctionWrapper.cpp:192
GUIJunctionWrapper::getParameterWindow
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIJunctionWrapper.cpp:112
GUIGlObject
Definition: GUIGlObject.h:65
GUIJunctionWrapper
Definition: GUIJunctionWrapper.h:60
GUIJunctionWrapper::myJunction
MSJunction & myJunction
A reference to the represented junction.
Definition: GUIJunctionWrapper.h:148
GUIJunctionWrapper::myTLLID
const std::string myTLLID
the associated traffic light or ""
Definition: GUIJunctionWrapper.h:165
GUIMainWindow
Definition: GUIMainWindow.h:46
GUIJunctionWrapper::operator=
GUIJunctionWrapper & operator=(const GUIJunctionWrapper &)
Invalidated assignment operator.
GUIJunctionWrapper::~GUIJunctionWrapper
virtual ~GUIJunctionWrapper()
Destructor.
Definition: GUIJunctionWrapper.cpp:94
config.h
GUIJunctionWrapper::myMaxSize
double myMaxSize
The maximum size (in either x-, or y-dimension) for determining whether to draw or not.
Definition: GUIJunctionWrapper.h:151
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
GUIJunctionWrapper::getOptionalName
const std::string getOptionalName() const
Returns the value for generic parameter 'name' or ''.
Definition: GUIJunctionWrapper.cpp:131
GUIJunctionWrapper::myBoundary
Boundary myBoundary
The represented junction's boundary.
Definition: GUIJunctionWrapper.h:154
PositionVector.h
GUIJunctionWrapper::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIJunctionWrapper.cpp:124
GUIJunctionWrapper::getJunction
const MSJunction & getJunction() const
Returns the represented junction.
Definition: GUIJunctionWrapper.h:130
GUIJunctionWrapper::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIJunctionWrapper.cpp:136
GUIJunctionWrapper::myAmRailway
bool myAmRailway
whether this junction has only railways as incoming and outgoing edges
Definition: GUIJunctionWrapper.h:162