Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEEdgeTemplate.cpp
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
22
23#include "GNEEdgeTemplate.h"
24#include "GNELaneTemplate.h"
25
26// ===========================================================================
27// members methods
28// ===========================================================================
29
31 GNEAttributeCarrier(SUMO_TAG_EDGE, edge->getNet(), "", false),
32 myEdge(edge) {
33 // update lane templates
35}
36
37
39 for (const auto& laneTemplate : myLaneTemplates) {
40 delete laneTemplate;
41 }
42}
43
44
47 return nullptr;
48}
49
50
53 return nullptr;
54}
55
56
59 return nullptr;
60}
61
62
63const Parameterised*
65 return nullptr;
66}
67
68
69const std::vector<GNELaneTemplate*>&
73
74
75void
77 // first remove all laneTemplates
78 for (const auto& laneTemplate : myLaneTemplates) {
79 delete laneTemplate;
80 }
81 myLaneTemplates.clear();
82 // now set new laneTemplates
83 for (const auto& lane : myEdge->getChildLanes()) {
84 myLaneTemplates.push_back(new GNELaneTemplate(lane));
85 }
86}
87
88
91 return nullptr;
92}
93
94
95const GUIGlObject*
97 return nullptr;
98}
99
100
101void
103 throw InvalidArgument("cannot be called in templates");
104}
105
106
107bool
109 return false;
110}
111
112
113bool
115 return false;
116}
117
118
119bool
121 return false;
122}
123
124
125bool
127 return false;
128}
129
130
131bool
133 return false;
134}
135
136
137bool
139 return false;
140}
141
142
143bool
145 return false;
146}
147
148
149bool
151 return false;
152}
153
154
155std::string
159
160
161double
165
166
171
172
177
178
179void
180GNEEdgeTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) {
181 throw InvalidArgument("cannot be called in templates");
182}
183
184
185bool
186GNEEdgeTemplate::isValid(SumoXMLAttr /*key*/, const std::string& /*value*/) {
187 throw InvalidArgument("cannot be called in templates");
188}
189
190
191bool
193 // All attributes are disabled in templates
194 return false;
195}
196
197
198std::string
200 return myEdge->getPopUpID();
201}
202
203
204std::string
208
209// ===========================================================================
210// private
211// ===========================================================================
212
213void
214GNEEdgeTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/) {
215 throw InvalidArgument("cannot be called in templates");
216}
217
218/****************************************************************************/
@ SUMO_TAG_EDGE
begin/end of the description of an edge
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Position getCommonAttributePosition(SumoXMLAttr key) const
double getAttributeDouble(SumoXMLAttr key) const override
Definition GNEEdge.cpp:1193
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
Definition GNEEdge.cpp:1205
std::string getAttribute(SumoXMLAttr key) const override
Definition GNEEdge.cpp:1099
bool checkDrawFromContour() const override
check if draw from contour (green)
bool isAttributeEnabled(SumoXMLAttr key) const
~GNEEdgeTemplate()
Destructor.
GNEEdgeTemplate(const GNEEdge *edge)
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)
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
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
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.