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()),
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
73
74
75const std::vector<GNELaneTemplate*>&
79
80
81void
83 // first remove all laneTemplates
84 for (const auto& laneTemplate : myLaneTemplates) {
85 delete laneTemplate;
86 }
87 myLaneTemplates.clear();
88 // now set new laneTemplates
89 for (const auto& lane : myEdge->getChildLanes()) {
90 myLaneTemplates.push_back(new GNELaneTemplate(lane));
91 }
92}
93
94
97 return nullptr;
98}
99
100
101const GUIGlObject*
103 return nullptr;
104}
105
106
107void
109 throw InvalidArgument("cannot be called in templates");
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
155bool
157 return false;
158}
159
160
161std::string
165
166
167double
171
172
177
178
183
184
185void
186GNEEdgeTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) {
187 throw InvalidArgument("cannot be called in templates");
188}
189
190
191bool
192GNEEdgeTemplate::isValid(SumoXMLAttr /*key*/, const std::string& /*value*/) {
193 throw InvalidArgument("cannot be called in templates");
194}
195
196
197bool
199 // All attributes are disabled in templates
200 return false;
201}
202
203
204std::string
206 return myEdge->getPopUpID();
207}
208
209
210std::string
214
215// ===========================================================================
216// private
217// ===========================================================================
218
219void
220GNEEdgeTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/) {
221 throw InvalidArgument("cannot be called in templates");
222}
223
224/****************************************************************************/
@ 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:1195
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
Definition GNEEdge.cpp:1207
std::string getAttribute(SumoXMLAttr key) const override
Definition GNEEdge.cpp:1101
bool checkDrawFromContour() const override
check if draw from contour (green)
~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)
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)
bool isAttributeEnabled(SumoXMLAttr key) const override
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
get GNEMoveElement associated with this edgeTemplate
void updateGeometry() override
update pre-computed geometry information
Position getAttributePosition(SumoXMLAttr key) const override
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
GNEHierarchicalElement * getHierarchicalElement() override
methods to retrieve the elements linked to this edgeTemplate
GUIGlObject * getGUIGlObject() override
get GUIGlObject associated with this AttributeCarrier
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
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
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
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.