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 #include <config.h>
25 
26 #include "GNENetElement.h"
27 
28 // ===========================================================================
29 // class declarations
30 // ===========================================================================
32 class GNETLSEditorFrame;
33 class PositionVector;
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
44 class GNEInternalLane : public GUIGlObject, public FXDelegator {
46  FXDECLARE(GNEInternalLane)
47 
48 public:
49 
56  GNEInternalLane(GNETLSEditorFrame* editor, const std::string& id, const PositionVector& shape, int tlIndex, LinkState state = LINKSTATE_DEADEND);
57 
59  virtual ~GNEInternalLane();
60 
63 
71 
80 
87 
92  void drawGL(const GUIVisualizationSettings& s) const;
94 
96  void setLinkState(LinkState state);
97 
99  LinkState getLinkState() const;
100 
102  long onDefault(FXObject*, FXSelector, void*);
103 
105  int getTLIndex() const;
106 
109 
111  static RGBColor colorForLinksState(FXuint state);
112 
113 protected:
115  GNEInternalLane();
116 
117 private:
120 
124  std::vector<double> myShapeRotations;
125 
127  std::vector<double> myShapeLengths;
129 
131  FXuint myState;
132  FXDataTarget myStateTarget;
133 
136 
138  FXDataTarget stateTarget;
139 
142 
145 
148 
151 
152 private:
154  static const std::string& longNameForLinkState(FXuint state);
155 
158 
161 };
162 
163 
164 #endif
165 
166 /****************************************************************************/
167 
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)