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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // Holds geometrical values for a junction
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <string>
26 #include <utility>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class MSNet;
36 class MSJunction;
37 #ifdef HAVE_OSG
38 namespace osg {
39 class Geometry;
40 }
41 #endif
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
59 public:
63  GUIJunctionWrapper(MSJunction& junction, const std::string& tllID);
64 
65 
67  virtual ~GUIJunctionWrapper();
68 
69 
70 
72 
73 
82  GUISUMOAbstractView& parent);
83 
84 
93  GUIMainWindow& app, GUISUMOAbstractView& parent);
94 
95 
102 
104  const std::string getOptionalName() const;
105 
110  void drawGL(const GUIVisualizationSettings& s) const;
112 
117  return myBoundary;
118  }
119 
121  bool isInternal() const {
122  return myIsInternal;
123  }
124 
128  const MSJunction& getJunction() const {
129  return myJunction;
130  }
131 
132 
133 #ifdef HAVE_OSG
134  void setGeometry(osg::Geometry* geom) {
135  myGeom = geom;
136  }
137 
138  void updateColor(const GUIVisualizationSettings& s);
139 #endif
140 
141 private:
142  double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const;
143 
144 private:
147 
149  double myMaxSize;
150 
153 
156 
161 
163  const std::string myTLLID;
164 
165 #ifdef HAVE_OSG
166  osg::Geometry* myGeom;
167 #endif
168 
169 
170 private:
173 
176 
177 };
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
The popup menu of a globject.
double myMaxSize
The maximum size (in either x-, or y-dimension) for determining whether to draw or not.
GUIJunctionWrapper(const GUIJunctionWrapper &)
Invalidated copy constructor.
Boundary getBoundary() const
Returns the boundary of the junction.
Boundary myBoundary
The represented junction's boundary.
const MSJunction & getJunction() const
Returns the represented junction.
GUIJunctionWrapper & operator=(const GUIJunctionWrapper &)
Invalidated assignment operator.
const std::string myTLLID
the associated traffic light or ""
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
const std::string getOptionalName() const
Returns the value for generic parameter 'name' or ''.
bool isInternal() const
whether this is an inner junction (a waiting spot for crossing a "real" junction)
bool myAmRailway
whether this junction has only railways as incoming and outgoing edges
bool myIsInternal
whether this wraps an instance of MSInternalJunction
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool myAmWaterway
whether this junction has only waterways as incoming and outgoing edges
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GUIJunctionWrapper(MSJunction &junction, const std::string &tllID)
Constructor.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
MSJunction & myJunction
A reference to the represented junction.
virtual ~GUIJunctionWrapper()
Destructor.
A window containing a gl-object's parameter.
Stores the information about how to visualize structures.
The base class for an intersection.
Definition: MSJunction.h:58
The simulated network and simulation perfomer.
Definition: MSNet.h:89