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 
46 const std::string&
48  return myLane->getID();
49 }
50 
51 
54  return nullptr;
55 }
56 
57 
58 void
60  throw InvalidArgument("cannot be called in templates");
61 }
62 
63 
64 std::string
66  return myLane->getAttribute(key);
67 }
68 
69 
70 void
71 GNELaneTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) {
72  throw InvalidArgument("cannot be called in templates");
73 }
74 
75 
76 bool
77 GNELaneTemplate::isValid(SumoXMLAttr /*key*/, const std::string& /*value*/) {
78  throw InvalidArgument("cannot be called in templates");
79 }
80 
81 void
83  throw InvalidArgument("cannot be called in templates");
84 }
85 
86 
87 void
89  throw InvalidArgument("cannot be called in templates");
90 }
91 
92 
93 bool
95  return false;
96 }
97 
98 
99 bool
101  return false;
102 }
103 
104 
105 std::string
107  return myLane->getPopUpID();
108 }
109 
110 
111 std::string
113  return myLane->getHierarchyName();
114 }
115 
116 
117 const std::map<std::string, std::string>&
119  return myLane->getACParametersMap();
120 }
121 
122 // ===========================================================================
123 // private
124 // ===========================================================================
125 
126 void
127 GNELaneTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/) {
128  throw InvalidArgument("cannot be called in templates");
129 }
130 
131 void
132 GNELaneTemplate::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) {
133  throw InvalidArgument("cannot be called in templates");
134 }
135 
136 /****************************************************************************/
@ 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:844
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
Definition: GNELane.cpp:1025
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
const GNELane * myLane
pointer to original lane
~GNELaneTemplate()
Destructor.
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
GUIGlObject * getGUIGlObject()
get GUIGlObject associated with this AttributeCarrier
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
void updateGeometry()
update pre-computed geometry information
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
bool isValid(SumoXMLAttr key, const std::string &value)
bool isAttributeComputed(SumoXMLAttr key) const
void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters)
method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute)
GNELaneTemplate(const GNELane *lane)
Constructor.
GNEHierarchicalElement * getHierarchicalElement()
get GNEHierarchicalElement associated with this AttributeCarrier
const std::string & getID() const
return ID of object
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)
const std::string & getID() const
get ID