Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEInternalLane.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// A class for visualizing Inner Lanes (used when editing traffic lights)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22#include "GNENetworkElement.h"
23
24// ===========================================================================
25// class declarations
26// ===========================================================================
29class PositionVector;
30
31
32// ===========================================================================
33// class definitions
34// ===========================================================================
35
36class GNEInternalLane : public GNENetworkElement, public FXDelegator {
38 FXDECLARE(GNEInternalLane)
40public:
48 GNEInternalLane(GNETLSEditorFrame* editor, GNEJunction* junctionParent, const std::string& id,
49 const PositionVector& shape, int tlIndex, LinkState state = LINKSTATE_DEADEND);
50
53
56
58 GNEMoveElement* getMoveElement() const override;
59
61 Parameterised* getParameters() override;
62
64 const Parameterised* getParameters() const override;
65
67
70
72 void updateGeometry() override;
73
76
78
81
83 bool checkDrawFromContour() const override;
84
86 bool checkDrawToContour() const override;
87
89 bool checkDrawRelatedContour() const override;
90
92 bool checkDrawOverContour() const override;
93
95 bool checkDrawDeleteContour() const override;
96
98 bool checkDrawDeleteContourSmall() const override;
99
101 bool checkDrawSelectContour() const override;
102
104 bool checkDrawMoveContour() const override;
105
107
112
114 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
116
119
127
136
139
141 void updateCenteringBoundary(const bool updateGrid);
142
147 void drawGL(const GUIVisualizationSettings& s) const;
148
150 void deleteGLObject();
151
153 void updateGLObject();
154
156
158 void setLinkState(LinkState state);
159
161 LinkState getLinkState() const;
162
164 long onDefault(FXObject*, FXSelector, void*);
165
167 int getTLIndex() const;
168
170 static const StringBijection<FXuint> LinkStateNames;
171
173 static RGBColor colorForLinksState(FXuint state);
174
177 /* @brief method for getting the Attribute of an XML key
178 * @param[in] key The attribute key
179 * @return string with the value associated to key
180 */
181 std::string getAttribute(SumoXMLAttr key) const override;
182
183 /* @brief method for getting the Attribute of an XML key in double format
184 * @param[in] key The attribute key
185 * @return double with the value associated to key
186 */
187 double getAttributeDouble(SumoXMLAttr key) const override;
188
189 /* @brief method for getting the Attribute of an XML key in position format
190 * @param[in] key The attribute key
191 * @return position with the value associated to key
192 */
193 Position getAttributePosition(SumoXMLAttr key) const override;
194
195 /* @brief method for getting the Attribute of an XML key in Position format
196 * @param[in] key The attribute key
197 * @return position with the value associated to key
198 */
200
201 /* @brief method for setting the attribute and letting the object perform additional changes
202 * @param[in] key The attribute key
203 * @param[in] value The new value
204 * @param[in] undoList The undoList on which to register changes
205 */
206 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
207
208 /* @brief method for checking if the key and their conrrespond attribute are valids
209 * @param[in] key The attribute key
210 * @param[in] value The value associated to key key
211 * @return true if the value is valid, false in other case
212 */
213 bool isValid(SumoXMLAttr key, const std::string& value) override;
214
216
217protected:
220
221private:
224
227
229 FXuint myState;
230 FXDataTarget myStateTarget;
231
234
236 FXDataTarget stateTarget;
237
240
243
246
248 static StringBijection<FXuint>::Entry linkStateNamesValues[];
249
250private:
252 void setAttribute(SumoXMLAttr key, const std::string& value) override;
253
256
258 GNEInternalLane& operator=(const GNEInternalLane&) = delete;
259};
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_DEADEND
This is a dead end link.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
void deleteGLObject()
delete element
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
bool checkDrawOverContour() const override
check if draw over contour (orange)
void updateGeometry() override
update pre-computed geometry information
Parameterised * getParameters() override
get parameters associated with this internalLane
bool checkDrawDeleteContour() const override
check if draw delete contour (pink/white)
long onDefault(FXObject *, FXSelector, void *)
multiplexes message to two targets
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
LinkState myOrigState
the original state of the link (used for tracking modification)
bool checkDrawSelectContour() const override
check if draw select contour (blue)
PositionVector getAttributePositionVector(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
bool checkDrawMoveContour() const override
check if draw move contour (red)
FXuint myState
the state of the link (used for visualization)
double getAttributeDouble(SumoXMLAttr key) const override
LinkState getLinkState() const
whether link state has been modified
FXDataTarget myStateTarget
int myTlIndex
the tl-index of this lane
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this internalLane
GUIGLObjectPopupMenu * myPopup
the created popup
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Position getPositionInView() const
Returns position of hierarchical element in view.
bool checkDrawDeleteContourSmall() const override
check if draw delete contour small (pink/white)
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
GNEMoveOperation * getMoveOperation()
static StringBijection< FXuint >::Entry linkStateNamesValues[]
linkstates names values
bool checkDrawToContour() const override
check if draw from contour (magenta)
FXDataTarget stateTarget
data target for selection state
std::string getAttribute(SumoXMLAttr key) const override
GUIGeometry myInternalLaneGeometry
internal lane geometry
static const StringBijection< FXuint > LinkStateNames
long names for link states
int getTLIndex() const
get Traffic Light index
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Position getAttributePosition(SumoXMLAttr key) const override
void updateGLObject()
update GLObject (geometry, ID, etc.)
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
bool isValid(SumoXMLAttr key, const std::string &value) override
bool checkDrawFromContour() const override
check if draw from contour (green)
void setLinkState(LinkState state)
set the linkState (controls drawing color)
GNETLSEditorFrame * myEditor
the editor to inform about changes
GNEJunction * myJunctionParent
pointer to junction parent
The popup menu of a globject.
A window containing a gl-object's parameter.
Stores the information about how to visualize structures.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.
Definition json.hpp:4471