Eclipse 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-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 /****************************************************************************/
14 // A class for visualizing Inner Lanes (used when editing traffic lights)
15 /****************************************************************************/
16 #ifndef GNEInternalLane_h
17 #define GNEInternalLane_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include "GNENetElement.h"
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
30 class GNETLSEditorFrame;
31 class PositionVector;
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
42 class GNEInternalLane : public GUIGlObject, public FXDelegator {
44  FXDECLARE(GNEInternalLane)
45 
46 public:
47 
54  GNEInternalLane(GNETLSEditorFrame* editor, const std::string& id, const PositionVector& shape, int tlIndex, LinkState state = LINKSTATE_DEADEND);
55 
57  virtual ~GNEInternalLane();
58 
61 
69 
78 
85 
90  void drawGL(const GUIVisualizationSettings& s) const;
92 
94  void setLinkState(LinkState state);
95 
97  LinkState getLinkState() const;
98 
100  long onDefault(FXObject*, FXSelector, void*);
101 
103  int getTLIndex() const;
104 
107 
109  static RGBColor colorForLinksState(FXuint state);
110 
111 protected:
113  GNEInternalLane();
114 
115 private:
118 
120  FXuint myState;
121  FXDataTarget myStateTarget;
122 
125 
127  FXDataTarget stateTarget;
128 
131 
134 
137 
140 
141 private:
143  static const std::string& longNameForLinkState(FXuint state);
144 
147 
150 };
151 
152 
153 #endif
154 
155 /****************************************************************************/
156 
GUIParameterTableWindow
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:62
GNEInternalLane::stateTarget
FXDataTarget stateTarget
data target for selection state
Definition: GNEInternalLane.h:127
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:72
GNEInternalLane::myPopup
GUIGLObjectPopupMenu * myPopup
the created popup
Definition: GNEInternalLane.h:136
GNEInternalLane::myEditor
GNETLSEditorFrame * myEditor
the editor to inform about changes
Definition: GNEInternalLane.h:130
PositionVector
A list of positions.
Definition: PositionVector.h:45
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:47
RGBColor
Definition: RGBColor.h:39
LinkState
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
Definition: SUMOXMLDefinitions.h:1137
StringBijection< FXuint >
GNEInternalLane::myState
FXuint myState
the state of the link (used for visualization)
Definition: GNEInternalLane.h:120
GNENetElement.h
GNEInternalLane::myInternalLaneGeometry
GNEGeometry::Geometry myInternalLaneGeometry
internal lane geometry
Definition: GNEInternalLane.h:117
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNEInternalLane::colorForLinksState
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
Definition: GNEInternalLane.cpp:184
GNEInternalLane::setLinkState
void setLinkState(LinkState state)
set the linkState (controls drawing color)
Definition: GNEInternalLane.cpp:129
GNEInternalLane::getTLIndex
int getTLIndex() const
get Traffic Light index
Definition: GNEInternalLane.cpp:142
LINKSTATE_DEADEND
This is a dead end link.
Definition: SUMOXMLDefinitions.h:1167
GNEInternalLane::myStateTarget
FXDataTarget myStateTarget
Definition: GNEInternalLane.h:121
GNEGeometry::Geometry
struct for pack all variables related with geometry of stop
Definition: GNEGeometry.h:56
GUIGlObject
Definition: GUIGlObject.h:65
GNEInternalLane::~GNEInternalLane
virtual ~GNEInternalLane()
Destructor.
Definition: GNEInternalLane.cpp:87
GNEInternalLane::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNEInternalLane.cpp:148
GUIMainWindow
Definition: GUIMainWindow.h:46
GNEInternalLane::operator=
GNEInternalLane & operator=(const GNEInternalLane &)
Invalidated assignment operator.
GNEInternalLane::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEInternalLane.cpp:111
GNEInternalLane::longNameForLinkState
static const std::string & longNameForLinkState(FXuint state)
return the color for each linkstate
GNEInternalLane::getParameterWindow
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNEInternalLane.cpp:166
GNEInternalLane
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNEInternalLane.h:42
GNEInternalLane::GNEInternalLane
GNEInternalLane()
FOX needs this.
Definition: GNEInternalLane.cpp:81
GNEInternalLane::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEInternalLane.cpp:176
GNEInternalLane::myOrigState
LinkState myOrigState
the original state of the link (used for tracking modification)
Definition: GNEInternalLane.h:124
GNEInternalLane::getLinkState
LinkState getLinkState() const
whether link state has been modfied
Definition: GNEInternalLane.cpp:136
GNEInternalLane::myTlIndex
int myTlIndex
the tl-index of this lane
Definition: GNEInternalLane.h:133
GNEInternalLane::LinkStateNames
static const StringBijection< FXuint > LinkStateNames
long names for link states
Definition: GNEInternalLane.h:106
GNEInternalLane::linkStateNamesValues
static StringBijection< FXuint >::Entry linkStateNamesValues[]
linkstates names values
Definition: GNEInternalLane.h:139
GNEInternalLane::onDefault
long onDefault(FXObject *, FXSelector, void *)
multiplexes message to two targets
Definition: GNEInternalLane.cpp:91
GNETLSEditorFrame
Definition: GNETLSEditorFrame.h:40
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345