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-2026 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// class declarations
28// ===========================================================================
29
30class GNELaneType;
31class GNEEdgeTemplate;
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
37
39
40public:
42 friend class GNECreateEdgeFrame;
43
45 GNEEdgeType(GNENet* net);
46
48 GNEEdgeType(GNENet* net, const std::string& ID);
49
51 GNEEdgeType(const GNEEdgeType* edgeType);
52
59 GNEEdgeType(GNENet* net, const std::string& ID, const NBTypeCont::EdgeTypeDefinition* edgeType);
60
63
66
68 GNEMoveElement* getMoveElement() const override;
69
71 Parameterised* getParameters() override;
72
74 const Parameterised* getParameters() const override;
75
77
79 void copyTemplate(const GNEEdgeTemplate* edgeTemplate);
80
82 const std::vector<GNELaneType*>& getLaneTypes() const;
83
85 int getLaneTypeIndex(const GNELaneType* laneType) const;
86
88 void addLaneType(GNELaneType* laneType);
89
91 void removeLaneType(const int index);
92
95
97 void updateGeometry() override;
98
101
103
106
108 bool checkDrawFromContour() const override;
109
111 bool checkDrawToContour() const override;
112
114 bool checkDrawRelatedContour() const override;
115
117 bool checkDrawOverContour() const override;
118
120 bool checkDrawDeleteContour() const override;
121
123 bool checkDrawDeleteContourSmall() const override;
124
126 bool checkDrawSelectContour() const override;
127
129 bool checkDrawMoveContour() const override;
130
132
135
143
145 Boundary getCenteringBoundary() const override;
146
148 void updateCenteringBoundary(const bool updateGrid);
149
154 void drawGL(const GUIVisualizationSettings& s) const override;
155
157 void deleteGLObject() override;
158
160 void updateGLObject() override;
162
165 /* @brief method for getting the Attribute of an XML key
166 * @param[in] key The attribute key
167 * @return string with the value associated to key
168 */
169 std::string getAttribute(SumoXMLAttr key) const override;
170
171 /* @brief method for getting the Attribute of an XML key in double format
172 * @param[in] key The attribute key
173 * @return double with the value associated to key
174 */
175 double getAttributeDouble(SumoXMLAttr key) const override;
176
177 /* @brief method for getting the Attribute of an XML key in position format
178 * @param[in] key The attribute key
179 * @return position with the value associated to key
180 */
181 Position getAttributePosition(SumoXMLAttr key) const override;
182
183 /* @brief method for getting the Attribute of an XML key in Position format
184 * @param[in] key The attribute key
185 * @return position with the value associated to key
186 */
188
189 /* @brief method for setting the attribute and letting the object perform additional changes
190 * @param[in] key The attribute key
191 * @param[in] value The new value
192 * @param[in] undoList The undoList on which to register changes
193 */
194 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
195
196 /* @brief method for checking if the key and their conrrespond attribute are valids
197 * @param[in] key The attribute key
198 * @param[in] value The value associated to key key
199 * @return true if the value is valid, false in other case
200 */
201 bool isValid(SumoXMLAttr key, const std::string& value) override;
202
203 /* @brief method for check if the value for certain attribute is set
204 * @param[in] key The attribute key
205 */
206 bool isAttributeEnabled(SumoXMLAttr key) const override;
207
209
210protected:
212 std::vector<GNELaneType*> myLaneTypes;
213
214private:
216 void setAttribute(SumoXMLAttr key, const std::string& value) override;
217
219 GNEEdgeType(const GNEEdgeType& s) = delete;
220
222 GNEEdgeType& operator=(const GNEEdgeType& s) = delete;
223};
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
std::vector< GNELaneType * > myLaneTypes
vector with laneTypes
void updateGeometry() override
update pre-computed geometry information
Position getPositionInView() const
Returns position of hierarchical element in view.
int getLaneTypeIndex(const GNELaneType *laneType) const
get laneType index
GNEEdgeType(const GNEEdgeType &s)=delete
invalidated copy constructor
GNEEdgeType & operator=(const GNEEdgeType &s)=delete
invalidated assignment operator
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
std::string getAttribute(SumoXMLAttr key) const override
double getAttributeDouble(SumoXMLAttr key) const override
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool checkDrawDeleteContourSmall() const override
check if draw delete contour small (pink/white)
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
Parameterised * getParameters() override
get parameters associated with this edgeType
void removeLaneType(const int index)
remove laneType
void copyTemplate(const GNEEdgeTemplate *edgeTemplate)
copy edge template
bool checkDrawFromContour() const override
check if draw from contour (green)
bool isAttributeEnabled(SumoXMLAttr key) const override
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
bool checkDrawOverContour() const override
check if draw over contour (orange)
bool checkDrawMoveContour() const override
check if draw move contour (red)
friend class GNECreateEdgeFrame
GNECreateEdgeFrame need access to setAttribute.
Definition GNEEdgeType.h:42
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
bool checkDrawDeleteContour() const override
check if draw delete contour (pink/white)
bool isValid(SumoXMLAttr key, const std::string &value) override
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
const std::vector< GNELaneType * > & getLaneTypes() const
get laneTypes
void addLaneType(GNELaneType *laneType)
add laneType
bool checkDrawSelectContour() const override
check if draw select contour (blue)
void updateGLObject() override
update GLObject (geometry, ID, etc.)
GNEEdgeType(GNENet *net)
default constructor
~GNEEdgeType()
Destructor.
void deleteGLObject() override
delete element
Position getAttributePosition(SumoXMLAttr key) const override
bool checkDrawToContour() const override
check if draw from contour (magenta)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this edgeType
GNENetworkElement(GNENet *net, SumoXMLTag tag)
Constructor for templates.
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.
edgeType definition
Definition NBTypeCont.h:93