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 /****************************************************************************/
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
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:63
GNEInternalLane::stateTarget
FXDataTarget stateTarget
data target for selection state
Definition: GNEInternalLane.h:137
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:73
GNEInternalLane::myPopup
GUIGLObjectPopupMenu * myPopup
the created popup
Definition: GNEInternalLane.h:146
GNEInternalLane::myEditor
GNETLSEditorFrame * myEditor
the editor to inform about changes
Definition: GNEInternalLane.h:140
PositionVector
A list of positions.
Definition: PositionVector.h:46
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:48
RGBColor
Definition: RGBColor.h:40
LinkState
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
Definition: SUMOXMLDefinitions.h:1132
StringBijection< FXuint >
GNEInternalLane::myState
FXuint myState
the state of the link (used for visualization)
Definition: GNEInternalLane.h:130
GNENetElement.h
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
GNEInternalLane::colorForLinksState
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
Definition: GNEInternalLane.cpp:194
GNEInternalLane::setLinkState
void setLinkState(LinkState state)
set the linkState (controls drawing color)
Definition: GNEInternalLane.cpp:139
GNEInternalLane::getTLIndex
int getTLIndex() const
get Traffic Light index
Definition: GNEInternalLane.cpp:152
LINKSTATE_DEADEND
This is a dead end link.
Definition: SUMOXMLDefinitions.h:1162
GNEInternalLane::myStateTarget
FXDataTarget myStateTarget
Definition: GNEInternalLane.h:131
GUIGlObject
Definition: GUIGlObject.h:66
GNEInternalLane::~GNEInternalLane
virtual ~GNEInternalLane()
Destructor.
Definition: GNEInternalLane.cpp:97
GNEInternalLane::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNEInternalLane.cpp:158
GUIMainWindow
Definition: GUIMainWindow.h:47
GNEInternalLane::operator=
GNEInternalLane & operator=(const GNEInternalLane &)
Invalidated assignment operator.
GNEInternalLane::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEInternalLane.cpp:121
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:176
GNEInternalLane
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNEInternalLane.h:43
GNEInternalLane::GNEInternalLane
GNEInternalLane()
FOX needs this.
Definition: GNEInternalLane.cpp:91
GNEInternalLane::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEInternalLane.cpp:186
GNEInternalLane::myOrigState
LinkState myOrigState
the original state of the link (used for tracking modification)
Definition: GNEInternalLane.h:134
GNEInternalLane::getLinkState
LinkState getLinkState() const
whether link state has been modfied
Definition: GNEInternalLane.cpp:146
GNEInternalLane::myTlIndex
int myTlIndex
the tl-index of this lane
Definition: GNEInternalLane.h:143
GNEInternalLane::myShapeRotations
std::vector< double > myShapeRotations
Definition: GNEInternalLane.h:123
GNEInternalLane::LinkStateNames
static const StringBijection< FXuint > LinkStateNames
long names for link states
Definition: GNEInternalLane.h:107
GNEInternalLane::linkStateNamesValues
static StringBijection< FXuint >::Entry linkStateNamesValues[]
linkstates names values
Definition: GNEInternalLane.h:149
GNEInternalLane::onDefault
long onDefault(FXObject *, FXSelector, void *)
multiplexes message to two targets
Definition: GNEInternalLane.cpp:101
GNETLSEditorFrame
Definition: GNETLSEditorFrame.h:41
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
GNEInternalLane::myShapeLengths
std::vector< double > myShapeLengths
The lengths of the shape parts.
Definition: GNEInternalLane.h:126
GNEInternalLane::myShape
const PositionVector myShape
the shape of the edge
Definition: GNEInternalLane.h:118