SUMO - Simulation of Urban MObility
GNEInternalLane.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A class for visualizing Inner Lanes (used when editing traffic lights)
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEInternalLane_h
21 #define GNEInternalLane_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
41 class GNETLSEditor;
42 class PositionVector;
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
53 class GNEInternalLane : public GUIGlObject, public FXDelegator {
54  // FOX-declarations
55  FXDECLARE(GNEInternalLane)
56 
57 public:
58 
65  GNEInternalLane(GNETLSEditor* editor, const std::string& id, const PositionVector& shape, int tlIndex, LinkState state = LINKSTATE_DEADEND);
66 
68  virtual ~GNEInternalLane() ;
69 
71 
72 
81  GUISUMOAbstractView& parent) ;
82 
91  GUISUMOAbstractView& parent) ;
92 
99 
104  void drawGL(const GUIVisualizationSettings& s) const ;
106 
108  void setLinkState(LinkState state) {
109  myState = state;
110  myOrigState = state;
111  }
112 
115  return (LinkState)myState;
116  }
117 
118 
120  long onDefault(FXObject*, FXSelector, void*);
121 
122 
123  inline int getTLIndex() const {
124  return myTlIndex;
125  }
126 
129 
130  // @brief return the color for each linkstate
131  static RGBColor colorForLinksState(FXuint state);
132 
133 protected:
135  GNEInternalLane();
136 
137 private:
138 
141 
143 
144  std::vector<SUMOReal> myShapeRotations;
146 
148  std::vector<SUMOReal> myShapeLengths;
150 
152  FXuint myState;
153  FXDataTarget myStateTarget;
154 
157 
159  FXDataTarget stateTarget;
160 
163 
166 
169 
171 
172 private:
173 
174  // @brief return the color for each linkstate
175  static const std::string& longNameForLinkState(FXuint state);
176 
179 
182 
183 };
184 
185 
186 #endif
187 
188 /****************************************************************************/
189 
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)
static RGBColor colorForLinksState(FXuint state)
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[]
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
FXDataTarget myStateTarget
LinkState myOrigState
the original state of the link (used for tracking modification)
LinkState getLinkState()
whether link state has been modfied
A list of positions.
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
std::vector< SUMOReal > myShapeRotations
The rotations of the shape parts.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
FXDataTarget stateTarget
data target for selection state
int getTLIndex() const
long onDefault(FXObject *, FXSelector, void *)
multiplexes message to two targets
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
virtual ~GNEInternalLane()
Destructor.
GNEInternalLane & operator=(const GNEInternalLane &)
Invalidated assignment operator.
The popup menu of a globject.
GNETLSEditor * myEditor
the editor to inform about changes
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.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNEInternalLane()
FOX needs this.
A window containing a gl-object&#39;s parameter.
FXuint myState
the state of the link (used for visualization)