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-2022 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 
92  GUIMainWindow& app, GUISUMOAbstractView& parent);
93 
95  double getExaggeration(const GUIVisualizationSettings& s) const;
96 
103 
105  const std::string getOptionalName() const;
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 };
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.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
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:88