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 void copyLaneType(GNELaneType* originalLaneType, GNEUndoList* undoList);
54
57
59 void updateGeometry();
60
63
65
68
70 bool checkDrawFromContour() const;
71
73 bool checkDrawToContour() const;
74
76 bool checkDrawRelatedContour() const;
77
79 bool checkDrawOverContour() const;
80
82 bool checkDrawDeleteContour() const;
83
85 bool checkDrawDeleteContourSmall() const;
86
88 bool checkDrawSelectContour() const;
89
91 bool checkDrawMoveContour() const;
92
94
99
101 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
103
106
114
117
119 void updateCenteringBoundary(const bool updateGrid);
120
125 void drawGL(const GUIVisualizationSettings& s) const;
126
128 void deleteGLObject();
129
131 void updateGLObject();
133
136 /* @brief method for getting the Attribute of an XML key
137 * @param[in] key The attribute key
138 * @return string with the value associated to key
139 */
140 std::string getAttribute(SumoXMLAttr key) const;
141
142 /* @brief method for getting the Attribute of an XML key in Position format
143 * @param[in] key The attribute key
144 * @return position with the value associated to key
145 */
147
148 /* @brief method for setting the attribute and letting the object perform additional changes
149 * @param[in] key The attribute key
150 * @param[in] value The new value
151 * @param[in] undoList The undoList on which to register changes
152 */
153 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
154
155 /* @brief method for checking if the key and their conrrespond attribute are valids
156 * @param[in] key The attribute key
157 * @param[in] value The value associated to key key
158 * @return true if the value is valid, false in other case
159 */
160 bool isValid(SumoXMLAttr key, const std::string& value);
161
163
166
167protected:
170
171private:
173 void setAttribute(SumoXMLAttr key, const std::string& value);
174
176 void setMoveShape(const GNEMoveResult& moveResult);
177
179 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
180
182 GNELaneType(const GNELaneType& s) = delete;
183
185 GNELaneType& operator=(const GNELaneType& s) = delete;
186};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
bool checkDrawDeleteContour() const
check if draw delete contour (pink/white)
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
GNELaneType & operator=(const GNELaneType &s)=delete
invalidated assignment operator
GNEEdgeType * myEdgeTypeParent
pointer to EdgeTypeParent
PositionVector getAttributePositionVector(SumoXMLAttr key) const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool checkDrawOverContour() const
check if draw over contour (orange)
Position getPositionInView() const
Returns position of hierarchical element in view.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void updateGeometry()
update pre-computed geometry information
bool checkDrawMoveContour() const
check if draw move contour (red)
bool isValid(SumoXMLAttr key, const std::string &value)
bool checkDrawRelatedContour() const
check if draw related contour (cyan)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
std::string getAttribute(SumoXMLAttr key) const
void deleteGLObject()
delete element
const Parameterised::Map & getACParametersMap() const
get parameters map
void copyLaneType(GNELaneType *originalLaneType, GNEUndoList *undoList)
copy values of given laneType in current laneType
GNEMoveOperation * getMoveOperation()
get move operation
GNEEdgeType * getEdgeTypeParent() const
get edge type parent
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
bool checkDrawSelectContour() const
check if draw select contour (blue)
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
~GNELaneType()
Destructor.
bool checkDrawToContour() const
check if draw from contour (magenta)
void updateGLObject()
update GLObject (geometry, ID, etc.)
bool checkDrawDeleteContourSmall() const
check if draw delete contour small (pink/white)
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
bool checkDrawFromContour() const
check if draw from contour (green)
GNELaneType(const GNELaneType &s)=delete
invalidated copy constructor
move operation
move result
The popup menu of a globject.
Stores the information about how to visualize structures.
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
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