SUMO - Simulation of Urban MObility
GNEInternalLane.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-2018 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 /****************************************************************************/
15 // A class for visualizing Inner Lanes (used when editing traffic lights)
16 /****************************************************************************/
17 #ifndef GNEInternalLane_h
18 #define GNEInternalLane_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 
25 #include "GNENetElement.h"
26 
27 // ===========================================================================
28 // class declarations
29 // ===========================================================================
31 class GNETLSEditorFrame;
32 class PositionVector;
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
43 class GNEInternalLane : public GUIGlObject, public FXDelegator {
45  FXDECLARE(GNEInternalLane)
46 
47 public:
48 
55  GNEInternalLane(GNETLSEditorFrame* editor, const std::string& id, const PositionVector& shape, int tlIndex, LinkState state = LINKSTATE_DEADEND);
56 
58  virtual ~GNEInternalLane();
59 
62 
70 
79 
86 
91  void drawGL(const GUIVisualizationSettings& s) const;
93 
95  void setLinkState(LinkState state);
96 
98  LinkState getLinkState() const;
99 
101  long onDefault(FXObject*, FXSelector, void*);
102 
104  int getTLIndex() const;
105 
108 
110  static RGBColor colorForLinksState(FXuint state);
111 
112 protected:
114  GNEInternalLane();
115 
116 private:
119 
123  std::vector<double> myShapeRotations;
124 
126  std::vector<double> myShapeLengths;
128 
130  FXuint myState;
131  FXDataTarget myStateTarget;
132 
135 
137  FXDataTarget stateTarget;
138 
141 
144 
147 
150 
151 private:
153  static const std::string& longNameForLinkState(FXuint state);
154 
157 
160 };
161 
162 
163 #endif
164 
165 /****************************************************************************/
166 
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Stores the information about how to visualize structures.
static const std::string & longNameForLinkState(FXuint state)
return the color for each linkstate
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
int myTlIndex
the tl-index of this lane
This is a dead end link.
const PositionVector myShape
the shape of the edge
static StringBijection< FXuint >::Entry linkStateNamesValues[]
linkstates names values
LinkState getLinkState() const
whether link state has been modfied
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
FXDataTarget myStateTarget
LinkState myOrigState
the original state of the link (used for tracking modification)
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
std::vector< double > myShapeRotations
A list of positions.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
int getTLIndex() const
get Traffic Light index
FXDataTarget stateTarget
data target for selection state
GNETLSEditorFrame * myEditor
the editor to inform about changes
long onDefault(FXObject *, FXSelector, void *)
multiplexes message to two targets
virtual ~GNEInternalLane()
Destructor.
std::vector< double > myShapeLengths
The lengths of the shape parts.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEInternalLane & operator=(const GNEInternalLane &)
Invalidated assignment operator.
The popup menu of a globject.
void setLinkState(LinkState state)
set the linkState (controls drawing color)
GUIGLObjectPopupMenu * myPopup
the created popup
static const StringBijection< FXuint > LinkStateNames
long names for link states
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GNEInternalLane()
FOX needs this.
A window containing a gl-object&#39;s parameter.
FXuint myState
the state of the link (used for visualization)