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-2024 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#include <config.h>
21
23
24#include "GNEEdgeTemplate.h"
25#include "GNELaneTemplate.h"
26
27// ===========================================================================
28// members methods
29// ===========================================================================
30
32 GNEAttributeCarrier(SUMO_TAG_EDGE, edge->getNet()),
33 myEdge(edge) {
34 // update lane templates
36}
37
38
40 for (const auto& laneTemplate : myLaneTemplates) {
41 delete laneTemplate;
42 }
43}
44
45
48 return nullptr;
49}
50
51
52const std::vector<GNELaneTemplate*>&
56
57
58void
60 // first remove all laneTemplates
61 for (const auto& laneTemplate : myLaneTemplates) {
62 delete laneTemplate;
63 }
64 myLaneTemplates.clear();
65 // now set new laneTemplates
66 for (const auto& lane : myEdge->getLanes()) {
67 myLaneTemplates.push_back(new GNELaneTemplate(lane));
68 }
69}
70
71
74 return nullptr;
75}
76
77
78const GUIGlObject*
80 return nullptr;
81}
82
83
84void
86 throw InvalidArgument("cannot be called in templates");
87}
88
89
90bool
92 return false;
93}
94
95
96bool
98 return false;
99}
100
101
102bool
104 return false;
105}
106
107
108bool
110 return false;
111}
112
113
114bool
116 return false;
117}
118
119
120bool
122 return false;
123}
124
125
126bool
128 return false;
129}
130
131
132std::string
136
137
142
143
144void
145GNEEdgeTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) {
146 throw InvalidArgument("cannot be called in templates");
147}
148
149
150bool
151GNEEdgeTemplate::isValid(SumoXMLAttr /*key*/, const std::string& /*value*/) {
152 throw InvalidArgument("cannot be called in templates");
153}
154
155
156bool
158 // All attributes are disabled in templates
159 return false;
160}
161
162
163std::string
165 return myEdge->getPopUpID();
166}
167
168
169std::string
173
174
179
180// ===========================================================================
181// private
182// ===========================================================================
183
184void
185GNEEdgeTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/) {
186 throw InvalidArgument("cannot be called in templates");
187}
188
189/****************************************************************************/
@ 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
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition GNEEdge.cpp:1118
std::string getAttribute(SumoXMLAttr key) const
Definition GNEEdge.cpp:1136
PositionVector getAttributePositionVector(SumoXMLAttr key) const
Definition GNEEdge.cpp:1228
const Parameterised::Map & getACParametersMap() const
get parameters map
Definition GNEEdge.cpp:1522
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 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)
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.