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-2017 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 "GNENetElement.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
39 class GNETLSEditorFrame;
40 class PositionVector;
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
51 class GNEInternalLane : public GUIGlObject, public FXDelegator {
53  FXDECLARE(GNEInternalLane)
54 
55 public:
56 
63  GNEInternalLane(GNETLSEditorFrame* editor, const std::string& id, const PositionVector& shape, int tlIndex, LinkState state = LINKSTATE_DEADEND);
64 
66  virtual ~GNEInternalLane();
67 
70 
78 
87 
94 
99  void drawGL(const GUIVisualizationSettings& s) const;
101 
103  void setLinkState(LinkState state);
104 
106  LinkState getLinkState() const;
107 
109  long onDefault(FXObject*, FXSelector, void*);
110 
112  int getTLIndex() const;
113 
116 
118  static RGBColor colorForLinksState(FXuint state);
119 
120 protected:
122  GNEInternalLane();
123 
124 private:
127 
131  std::vector<double> myShapeRotations;
132 
134  std::vector<double> myShapeLengths;
136 
138  FXuint myState;
139  FXDataTarget myStateTarget;
140 
143 
145  FXDataTarget stateTarget;
146 
149 
152 
155 
158 
159 private:
161  static const std::string& longNameForLinkState(FXuint state);
162 
165 
168 };
169 
170 
171 #endif
172 
173 /****************************************************************************/
174 
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:48
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)