Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEEdgeType.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#include "GNENetworkElement.h"
23
24#include <netbuild/NBTypeCont.h>
25
26
27// ===========================================================================
28// class declarations
29// ===========================================================================
30class GNELaneType;
31class GNEEdgeTemplate;
33
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
39public:
41 friend class GNECreateEdgeFrame;
42
46 GNEEdgeType(GNECreateEdgeFrame* createEdgeFrame);
47
49 GNEEdgeType(const GNEEdgeType* edgeType);
50
54 GNEEdgeType(GNENet* net);
55
62 GNEEdgeType(GNENet* net, const std::string& ID, const NBTypeCont::EdgeTypeDefinition* edgeType);
63
66
68 void copyTemplate(const GNEEdgeTemplate* edgeTemplate);
69
71 const std::vector<GNELaneType*>& getLaneTypes() const;
72
74 int getLaneTypeIndex(const GNELaneType* laneType) const;
75
77 void addLaneType(GNELaneType* laneType);
78
80 void removeLaneType(const int index);
81
84
86 void updateGeometry();
87
90
92
95
97 bool checkDrawFromContour() const;
98
100 bool checkDrawToContour() const;
101
103 bool checkDrawRelatedContour() const;
104
106 bool checkDrawOverContour() const;
107
109 bool checkDrawDeleteContour() const;
110
112 bool checkDrawDeleteContourSmall() const;
113
115 bool checkDrawSelectContour() const;
116
118 bool checkDrawMoveContour() const;
119
121
126
128 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
130
133
141
144
146 void updateCenteringBoundary(const bool updateGrid);
147
152 void drawGL(const GUIVisualizationSettings& s) const;
153
155 void deleteGLObject();
156
158 void updateGLObject();
160
163 /* @brief method for getting the Attribute of an XML key
164 * @param[in] key The attribute key
165 * @return string with the value associated to key
166 */
167 std::string getAttribute(SumoXMLAttr key) const;
168
169 /* @brief method for getting the Attribute of an XML key in Position format
170 * @param[in] key The attribute key
171 * @return position with the value associated to key
172 */
174
175 /* @brief method for setting the attribute and letting the object perform additional changes
176 * @param[in] key The attribute key
177 * @param[in] value The new value
178 * @param[in] undoList The undoList on which to register changes
179 */
180 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
181
182 /* @brief method for checking if the key and their conrrespond attribute are valids
183 * @param[in] key The attribute key
184 * @param[in] value The value associated to key key
185 * @return true if the value is valid, false in other case
186 */
187 bool isValid(SumoXMLAttr key, const std::string& value);
188
189 /* @brief method for check if the value for certain attribute is set
190 * @param[in] key The attribute key
191 */
192 bool isAttributeEnabled(SumoXMLAttr key) const;
193
195
198
199protected:
201 std::vector<GNELaneType*> myLaneTypes;
202
203private:
205 void setAttribute(SumoXMLAttr key, const std::string& value);
206
208 void setMoveShape(const GNEMoveResult& moveResult);
209
211 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
212
214 GNEEdgeType(const GNEEdgeType& s) = delete;
215
217 GNEEdgeType& operator=(const GNEEdgeType& s) = delete;
218};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
bool isAttributeEnabled(SumoXMLAttr key) const
std::vector< GNELaneType * > myLaneTypes
vector with laneTypes
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
bool checkDrawFromContour() const
check if draw from contour (green)
bool checkDrawDeleteContour() const
check if draw delete contour (pink/white)
bool checkDrawMoveContour() const
check if draw move contour (red)
bool checkDrawRelatedContour() const
check if draw related contour (cyan)
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Position getPositionInView() const
Returns position of hierarchical element in view.
const Parameterised::Map & getACParametersMap() const
get parameters map
int getLaneTypeIndex(const GNELaneType *laneType) const
get laneType index
bool isValid(SumoXMLAttr key, const std::string &value)
void deleteGLObject()
delete element
PositionVector getAttributePositionVector(SumoXMLAttr key) const
bool checkDrawSelectContour() const
check if draw select contour (blue)
GNEMoveOperation * getMoveOperation()
get move operation
bool checkDrawToContour() const
check if draw from contour (magenta)
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
GNEEdgeType(const GNEEdgeType &s)=delete
invalidated copy constructor
bool checkDrawOverContour() const
check if draw over contour (orange)
bool checkDrawDeleteContourSmall() const
check if draw delete contour small (pink/white)
GNEEdgeType & operator=(const GNEEdgeType &s)=delete
invalidated assignment operator
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void removeLaneType(const int index)
remove laneType
void copyTemplate(const GNEEdgeTemplate *edgeTemplate)
copy edge template
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
const std::vector< GNELaneType * > & getLaneTypes() const
get laneTypes
void addLaneType(GNELaneType *laneType)
add laneType
void updateGLObject()
update GLObject (geometry, ID, etc.)
~GNEEdgeType()
Destructor.
std::string getAttribute(SumoXMLAttr key) const
void updateGeometry()
update pre-computed geometry information
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
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.
edgeType definition
Definition NBTypeCont.h:93