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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // A class for visualizing Inner Lanes (used when editing traffic lights)
18 /****************************************************************************/
19 #ifndef GNEInternalLane_h
20 #define GNEInternalLane_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "GNENetElement.h"
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
38 class GNETLSEditorFrame;
39 class PositionVector;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
50 class GNEInternalLane : public GUIGlObject, public FXDelegator {
52  FXDECLARE(GNEInternalLane)
53 
54 public:
55 
62  GNEInternalLane(GNETLSEditorFrame* editor, const std::string& id, const PositionVector& shape, int tlIndex, LinkState state = LINKSTATE_DEADEND);
63 
65  virtual ~GNEInternalLane();
66 
69 
77 
86 
93 
98  void drawGL(const GUIVisualizationSettings& s) const;
100 
102  void setLinkState(LinkState state);
103 
105  LinkState getLinkState() const;
106 
108  long onDefault(FXObject*, FXSelector, void*);
109 
111  int getTLIndex() const;
112 
115 
117  static RGBColor colorForLinksState(FXuint state);
118 
119 protected:
121  GNEInternalLane();
122 
123 private:
126 
130  std::vector<double> myShapeRotations;
131 
133  std::vector<double> myShapeLengths;
135 
137  FXuint myState;
138  FXDataTarget myStateTarget;
139 
142 
144  FXDataTarget stateTarget;
145 
148 
151 
154 
157 
158 private:
160  static const std::string& longNameForLinkState(FXuint state);
161 
164 
167 };
168 
169 
170 #endif
171 
172 /****************************************************************************/
173 
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:47
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)