Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
51const std::vector<GNELaneTemplate*>&
55
56
57void
59 // first remove all laneTemplates
60 for (const auto& laneTemplate : myLaneTemplates) {
61 delete laneTemplate;
62 }
63 myLaneTemplates.clear();
64 // now set new laneTemplates
65 for (const auto& lane : myEdge->getChildLanes()) {
66 myLaneTemplates.push_back(new GNELaneTemplate(lane));
67 }
68}
69
70
73 return nullptr;
74}
75
76
77const GUIGlObject*
79 return nullptr;
80}
81
82
83void
85 throw InvalidArgument("cannot be called in templates");
86}
87
88
89bool
91 return false;
92}
93
94
95bool
97 return false;
98}
99
100
101bool
103 return false;
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
137std::string
141
142
147
148
149void
150GNEEdgeTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) {
151 throw InvalidArgument("cannot be called in templates");
152}
153
154
155bool
156GNEEdgeTemplate::isValid(SumoXMLAttr /*key*/, const std::string& /*value*/) {
157 throw InvalidArgument("cannot be called in templates");
158}
159
160
161bool
163 // All attributes are disabled in templates
164 return false;
165}
166
167
168std::string
170 return myEdge->getPopUpID();
171}
172
173
174std::string
178
179
184
185// ===========================================================================
186// private
187// ===========================================================================
188
189void
190GNEEdgeTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/) {
191 throw InvalidArgument("cannot be called in templates");
192}
193
194/****************************************************************************/
@ SUMO_TAG_EDGE
begin/end of the description of an edge
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
std::string getAttribute(SumoXMLAttr key) const
Definition GNEEdge.cpp:1175
PositionVector getAttributePositionVector(SumoXMLAttr key) const
Definition GNEEdge.cpp:1269
const Parameterised::Map & getACParametersMap() const
get parameters map
Definition GNEEdge.cpp:1560
bool isAttributeEnabled(SumoXMLAttr key) const
~GNEEdgeTemplate()
Destructor.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
GNEEdgeTemplate(const GNEEdge *edge)
Constructor.
const GNEEdge * myEdge
pointer to original edge
bool checkDrawDeleteContourSmall() const
check if draw delete contour small (pink/white)
bool checkDrawToContour() const
check if draw from contour (magenta)
std::string getAttribute(SumoXMLAttr key) const
GUIGlObject * getGUIGlObject()
get GUIGlObject associated with this AttributeCarrier
PositionVector getAttributePositionVector(SumoXMLAttr key) const
const std::vector< GNELaneTemplate * > & getLaneTemplates() const
get vector with the lane templates of this edge
bool checkDrawFromContour() const
check if draw from contour (green)
bool checkDrawMoveContour() const
check if draw move contour (red)
bool checkDrawOverContour() const
check if draw over contour (orange)
GNEHierarchicalElement * getHierarchicalElement()
get GNEHierarchicalElement associated with this AttributeCarrier
void updateGeometry()
update pre-computed geometry information
const Parameterised::Map & getACParametersMap() const
get parameters map
bool checkDrawSelectContour() const
check if draw select contour (blue)
bool checkDrawDeleteContour() const
check if draw delete contour (pink/white)
bool checkDrawRelatedContour() const
check if draw related contour (cyan)
bool isValid(SumoXMLAttr key, const std::string &value)
void updateLaneTemplates()
update lane templates
std::vector< GNELaneTemplate * > myLaneTemplates
vector with the lane templates of this edge
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::map< std::string, std::string > Map
parameters map
A list of positions.