Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEEdgeTemplate.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// Template for edges
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25// ===========================================================================
26// class declarations
27// ===========================================================================
28
29class GNEEdge;
30class GNELaneTemplate;
31
32// ===========================================================================
33// class definitions
34// ===========================================================================
35
37
38public:
40 GNEEdgeTemplate(const GNEEdge* edge);
41
44
47
50
52 GNEMoveElement* getMoveElement() const override;
53
55 Parameterised* getParameters() override;
56
58 const Parameterised* getParameters() const override;
59
61
63 const std::vector<GNELaneTemplate*>& getLaneTemplates() const;
64
67
70
72 GUIGlObject* getGUIGlObject() override;
73
75 const GUIGlObject* getGUIGlObject() const override;
76
78 void updateGeometry() override;
79
81
84
86 bool checkDrawFromContour() const override;
87
89 bool checkDrawToContour() const override;
90
92 bool checkDrawRelatedContour() const override;
93
95 bool checkDrawOverContour() const override;
96
98 bool checkDrawDeleteContour() const override;
99
101 bool checkDrawDeleteContourSmall() const override;
102
104 bool checkDrawSelectContour() const override;
105
107 bool checkDrawMoveContour() const override;
108
110
113 /* @brief method for getting the Attribute of an XML key
114 * @param[in] key The attribute key
115 * @return string with the value associated to key
116 */
117 std::string getAttribute(SumoXMLAttr key) const override;
118
119 /* @brief method for getting the Attribute of an XML key in double format
120 * @param[in] key The attribute key
121 * @return double with the value associated to key
122 */
123 double getAttributeDouble(SumoXMLAttr key) const override;
124
125 /* @brief method for getting the Attribute of an XML key in position format
126 * @param[in] key The attribute key
127 * @return position with the value associated to key
128 */
129 Position getAttributePosition(SumoXMLAttr key) const override;
130
131 /* @brief method for getting the Attribute of an XML key in Position format
132 * @param[in] key The attribute key
133 * @return position with the value associated to key
134 */
136
137 /* @brief method for setting the attribute and letting the object perform additional changes
138 * @param[in] key The attribute key
139 * @param[in] value The new value
140 * @param[in] undoList The undoList on which to register changes
141 */
142 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
143
144 /* @brief method for check if new value for certain attribute is valid
145 * @param[in] key The attribute key
146 * @param[in] value The new value
147 */
148 bool isValid(SumoXMLAttr key, const std::string& value) override;
149
150 /* @brief method for check if the value for certain attribute is set
151 * @param[in] key The attribute key
152 */
153 bool isAttributeEnabled(SumoXMLAttr key) const;
154
156 std::string getPopUpID() const override;
157
159 std::string getHierarchyName() const override;
160
162
163protected:
166
168 std::vector<GNELaneTemplate*> myLaneTemplates;
169
170private:
172 void setAttribute(SumoXMLAttr key, const std::string& value) override;
173
176
179};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
bool checkDrawFromContour() const override
check if draw from contour (green)
bool isAttributeEnabled(SumoXMLAttr key) const
~GNEEdgeTemplate()
Destructor.
GNEEdgeTemplate(const GNEEdgeTemplate &s)=delete
invalidated copy constructor
bool checkDrawSelectContour() const override
check if draw select contour (blue)
const GNEEdge * myEdge
pointer to original edge
bool checkDrawToContour() const override
check if draw from contour (magenta)
bool checkDrawDeleteContour() const override
check if draw delete contour (pink/white)
Parameterised * getParameters() override
get parameters associated with this edgeTemplate
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
GNEEdgeTemplate & operator=(const GNEEdgeTemplate &s)=delete
invalidated assignment operator
PositionVector getAttributePositionVector(SumoXMLAttr key) const
bool isValid(SumoXMLAttr key, const std::string &value) override
const std::vector< GNELaneTemplate * > & getLaneTemplates() const
get vector with the lane templates of this edge
bool checkDrawDeleteContourSmall() const override
check if draw delete contour small (pink/white)
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
GNEHierarchicalElement * getHierarchicalElement()
get GNEHierarchicalElement associated with this AttributeCarrier
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
bool checkDrawOverContour() const override
check if draw over contour (orange)
bool checkDrawMoveContour() const override
check if draw move contour (red)
std::string getAttribute(SumoXMLAttr key) const override
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this edgeTemplate
void updateGeometry() override
update pre-computed geometry information
Position getAttributePosition(SumoXMLAttr key) const override
GUIGlObject * getGUIGlObject() override
get GUIGlObject associated with this AttributeCarrier
double getAttributeDouble(SumoXMLAttr key) const override
void updateLaneTemplates()
update lane templates
std::vector< GNELaneTemplate * > myLaneTemplates
vector with the lane templates of this edge
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.