Eclipse SUMO - Simulation of Urban MObility
GNELaneTemplate.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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 lanes
19/****************************************************************************/
20#include <config.h>
21
23
24#include "GNELaneTemplate.h"
25
26// ===========================================================================
27// members methods
28// ===========================================================================
29
31 GNEAttributeCarrier(SUMO_TAG_LANE, lane->getNet()),
32 myLane(lane) {
33}
34
35
37}
38
39
42 return nullptr;
43}
44
45
48 return nullptr;
49}
50
51
52void
54 throw InvalidArgument("cannot be called in templates");
55}
56
57
58std::string
60 return myLane->getAttribute(key);
61}
62
63
64void
65GNELaneTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) {
66 throw InvalidArgument("cannot be called in templates");
67}
68
69
70bool
71GNELaneTemplate::isValid(SumoXMLAttr /*key*/, const std::string& /*value*/) {
72 throw InvalidArgument("cannot be called in templates");
73}
74
75
76bool
78 // All attributes are disabled in templates
79 return false;
80}
81
82
83std::string
85 return myLane->getPopUpID();
86}
87
88
89std::string
91 return myLane->getHierarchyName();
92}
93
94
97 return myLane->getACParametersMap();
98}
99
100// ===========================================================================
101// private
102// ===========================================================================
103
104void
105GNELaneTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/) {
106 throw InvalidArgument("cannot be called in templates");
107}
108
109/****************************************************************************/
@ SUMO_TAG_LANE
begin/end of the description of a single lane
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
std::string getAttribute(SumoXMLAttr key) const
Definition: GNELane.cpp:923
const Parameterised::Map & getACParametersMap() const
get parameters map
Definition: GNELane.cpp:1108
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
const GNELane * myLane
pointer to original lane
const Parameterised::Map & getACParametersMap() const
get parameters map
~GNELaneTemplate()
Destructor.
GUIGlObject * getGUIGlObject()
get GUIGlObject associated with this AttributeCarrier
void updateGeometry()
update pre-computed geometry information
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
bool isValid(SumoXMLAttr key, const std::string &value)
GNELaneTemplate(const GNELane *lane)
Constructor.
GNEHierarchicalElement * getHierarchicalElement()
get GNEHierarchicalElement associated with this AttributeCarrier
bool isAttributeEnabled(SumoXMLAttr key) const
std::string getAttribute(SumoXMLAttr key) const
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
Definition: Parameterised.h:45