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 /****************************************************************************/
17 // Holds geometrical values for a junction
18 /****************************************************************************/
19 #ifndef GUIJunctionWrapper_h
20 #define GUIJunctionWrapper_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
29 #include <utility>
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class MSNet;
39 class MSJunction;
40 #ifdef HAVE_OSG
41 namespace osg {
42 class Geometry;
43 }
44 #endif
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
62 public:
66  GUIJunctionWrapper(MSJunction& junction, const std::string& tllID);
67 
68 
70  virtual ~GUIJunctionWrapper();
71 
72 
73 
75 
76 
85  GUISUMOAbstractView& parent);
86 
87 
96  GUIMainWindow& app, GUISUMOAbstractView& parent);
97 
98 
105 
106 
111  void drawGL(const GUIVisualizationSettings& s) const;
113 
118  return myBoundary;
119  }
120 
122  bool isInternal() const {
123  return myIsInternal;
124  }
125 
129  const MSJunction& getJunction() const {
130  return myJunction;
131  }
132 
133 
134 #ifdef HAVE_OSG
135  void setGeometry(osg::Geometry* geom) {
136  myGeom = geom;
137  }
138 
139  void updateColor(const GUIVisualizationSettings& s);
140 #endif
141 
142 private:
143  double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const;
144 
145 private:
148 
150  double myMaxSize;
151 
154 
157 
162 
164  const std::string myTLLID;
165 
166 #ifdef HAVE_OSG
167  osg::Geometry* myGeom;
168 #endif
169 
170 
171 private:
174 
177 
178 };
179 
180 
181 #endif
182 
183 /****************************************************************************/
184 
GUIGlObject.h
GUIParameterTableWindow
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:63
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:73
MSJunction
The base class for an intersection.
Definition: MSJunction.h:61
GUIJunctionWrapper::getBoundary
Boundary getBoundary() const
Returns the boundary of the junction.
Definition: GUIJunctionWrapper.h:117
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:92
GUIGLObjectPopupMenu.h
GUIJunctionWrapper::myIsInternal
bool myIsInternal
whether this wraps an instance of MSInternalJunction
Definition: GUIJunctionWrapper.h:156
GUIJunctionWrapper::GUIJunctionWrapper
GUIJunctionWrapper(MSJunction &junction, const std::string &tllID)
Constructor.
Definition: GUIJunctionWrapper.cpp:58
GUIJunctionWrapper::isInternal
bool isInternal() const
whether this is an inner junction (a waiting spot for crossing a "real" junction)
Definition: GUIJunctionWrapper.h:122
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:48
GUIJunctionWrapper::myAmWaterway
bool myAmWaterway
whether this junction has only waterways as incoming and outgoing edges
Definition: GUIJunctionWrapper.h:159
GUIJunctionWrapper::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIJunctionWrapper.cpp:99
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
GUIJunctionWrapper::getColorValue
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
Definition: GUIJunctionWrapper.cpp:189
GUIJunctionWrapper::getParameterWindow
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIJunctionWrapper.cpp:113
GUIGlObject
Definition: GUIGlObject.h:66
GUIJunctionWrapper
Definition: GUIJunctionWrapper.h:61
GUIJunctionWrapper::myJunction
MSJunction & myJunction
A reference to the represented junction.
Definition: GUIJunctionWrapper.h:147
GUIJunctionWrapper::myTLLID
const std::string myTLLID
the associated traffic light or ""
Definition: GUIJunctionWrapper.h:164
GUIMainWindow
Definition: GUIMainWindow.h:47
GUIJunctionWrapper::operator=
GUIJunctionWrapper & operator=(const GUIJunctionWrapper &)
Invalidated assignment operator.
GUIJunctionWrapper::~GUIJunctionWrapper
virtual ~GUIJunctionWrapper()
Destructor.
Definition: GUIJunctionWrapper.cpp:95
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:150
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
GUIJunctionWrapper::myBoundary
Boundary myBoundary
The represented junction's boundary.
Definition: GUIJunctionWrapper.h:153
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:125
GUIJunctionWrapper::getJunction
const MSJunction & getJunction() const
Returns the represented junction.
Definition: GUIJunctionWrapper.h:129
GUIJunctionWrapper::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIJunctionWrapper.cpp:133
GUIJunctionWrapper::myAmRailway
bool myAmRailway
whether this junction has only railways as incoming and outgoing edges
Definition: GUIJunctionWrapper.h:161