Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNELaneType.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/****************************************************************************/
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNENetworkElement.h"
24
25#include <netbuild/NBTypeCont.h>
26
27class GNEEdgeType;
28
29// ===========================================================================
30// class definitions
31// ===========================================================================
32
34
35public:
37 friend class GNECreateEdgeFrame;
38 friend class GNEEdgeType;
39
41 GNELaneType(GNEEdgeType* edgeTypeParent);
42
44 GNELaneType(GNEEdgeType* edgeTypeParent, const NBTypeCont::LaneTypeDefinition& laneType);
45
48
51
53 GNEMoveElement* getMoveElement() const override;
54
56 Parameterised* getParameters() override;
57
59 const Parameterised* getParameters() const override;
60
62
65
67 void copyLaneType(GNELaneType* originalLaneType, GNEUndoList* undoList);
68
71
73 void updateGeometry() override;
74
77
79
82
84 bool checkDrawFromContour() const override;
85
87 bool checkDrawToContour() const override;
88
90 bool checkDrawRelatedContour() const override;
91
93 bool checkDrawOverContour() const override;
94
96 bool checkDrawDeleteContour() const override;
97
99 bool checkDrawDeleteContourSmall() const override;
100
102 bool checkDrawSelectContour() const override;
103
105 bool checkDrawMoveContour() const override;
106
108
111
119
121 Boundary getCenteringBoundary() const override;
122
124 void updateCenteringBoundary(const bool updateGrid);
125
130 void drawGL(const GUIVisualizationSettings& s) const override;
131
133 void deleteGLObject() override;
134
136 void updateGLObject() override;
138
141 /* @brief method for getting the Attribute of an XML key
142 * @param[in] key The attribute key
143 * @return string with the value associated to key
144 */
145 std::string getAttribute(SumoXMLAttr key) const override;
146
147 /* @brief method for getting the Attribute of an XML key in double format
148 * @param[in] key The attribute key
149 * @return double with the value associated to key
150 */
151 double getAttributeDouble(SumoXMLAttr key) const override;
152
153 /* @brief method for getting the Attribute of an XML key in position format
154 * @param[in] key The attribute key
155 * @return position with the value associated to key
156 */
157 Position getAttributePosition(SumoXMLAttr key) const override;
158
159 /* @brief method for getting the Attribute of an XML key in Position format
160 * @param[in] key The attribute key
161 * @return position with the value associated to key
162 */
164
165 /* @brief method for setting the attribute and letting the object perform additional changes
166 * @param[in] key The attribute key
167 * @param[in] value The new value
168 * @param[in] undoList The undoList on which to register changes
169 */
170 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
171
172 /* @brief method for checking if the key and their conrrespond attribute are valids
173 * @param[in] key The attribute key
174 * @param[in] value The value associated to key key
175 * @return true if the value is valid, false in other case
176 */
177 bool isValid(SumoXMLAttr key, const std::string& value) override;
178
180
181protected:
184
185private:
187 void setAttribute(SumoXMLAttr key, const std::string& value) override;
188
190 GNELaneType(const GNELaneType& s) = delete;
191
193 GNELaneType& operator=(const GNELaneType& s) = delete;
194};
const std::string invalid_return< std::string >::value
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
GNELaneType & operator=(const GNELaneType &s)=delete
invalidated assignment operator
void updateGeometry() override
update pre-computed geometry information
bool checkDrawMoveContour() const override
check if draw move contour (red)
GNEEdgeType * myEdgeTypeParent
pointer to EdgeTypeParent
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
bool isValid(SumoXMLAttr key, const std::string &value) override
Parameterised * getParameters() override
get parameters associated with this laneType
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Position getPositionInView() const
Returns position of hierarchical element in view.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
bool checkDrawOverContour() const override
check if draw over contour (orange)
double getAttributeDouble(SumoXMLAttr key) const override
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this laneType
GNELaneType(GNEEdgeType *edgeTypeParent)
Constructor.
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
void copyLaneType(GNELaneType *originalLaneType, GNEUndoList *undoList)
copy values of given laneType in current laneType
bool checkDrawDeleteContour() const override
check if draw delete contour (pink/white)
bool checkDrawFromContour() const override
check if draw from contour (green)
void updateGLObject() override
update GLObject (geometry, ID, etc.)
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
GNEEdgeType * getEdgeTypeParent() const
get edge type parent
bool checkDrawToContour() const override
check if draw from contour (magenta)
friend class GNECreateEdgeFrame
GNECreateEdgeFrame need access to setAttribute.
Definition GNELaneType.h:37
Position getAttributePosition(SumoXMLAttr key) const override
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
bool checkDrawSelectContour() const override
check if draw select contour (blue)
bool checkDrawDeleteContourSmall() const override
check if draw delete contour small (pink/white)
~GNELaneType()
Destructor.
friend class GNEEdgeType
Definition GNELaneType.h:38
void deleteGLObject() override
delete element
GNELaneType(const GNELaneType &s)=delete
invalidated copy constructor
std::string getAttribute(SumoXMLAttr key) const override
GNENetworkElement(GNENet *net, const std::string &id, SumoXMLTag tag)
Constructor.
The popup menu of a globject.
Stores the information about how to visualize structures.
Parameterised()
Default constructor.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.
laneType definition
Definition NBTypeCont.h:59