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.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 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 
52 const GUIGlObject*
54  return nullptr;
55 }
56 
57 
58 void
60  throw InvalidArgument("cannot be called in templates");
61 }
62 
63 
64 bool
66  return false;
67 }
68 
69 
70 bool
72  return false;
73 }
74 
75 
76 bool
78  return false;
79 }
80 
81 
82 bool
84  return false;
85 }
86 
87 
88 bool
90  return false;
91 }
92 
93 
94 bool
96  return false;
97 }
98 
99 
100 bool
102  return false;
103 }
104 
105 
106 std::string
108  return myLane->getAttribute(key);
109 }
110 
111 
114  return myLane->getAttributePositionVector(key);
115 }
116 
117 
118 void
119 GNELaneTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) {
120  throw InvalidArgument("cannot be called in templates");
121 }
122 
123 
124 bool
125 GNELaneTemplate::isValid(SumoXMLAttr /*key*/, const std::string& /*value*/) {
126  throw InvalidArgument("cannot be called in templates");
127 }
128 
129 
130 bool
132  // All attributes are disabled in templates
133  return false;
134 }
135 
136 
137 std::string
139  return myLane->getPopUpID();
140 }
141 
142 
143 std::string
145  return myLane->getHierarchyName();
146 }
147 
148 
149 const Parameterised::Map&
151  return myLane->getACParametersMap();
152 }
153 
154 // ===========================================================================
155 // private
156 // ===========================================================================
157 
158 void
159 GNELaneTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/) {
160  throw InvalidArgument("cannot be called in templates");
161 }
162 
163 /****************************************************************************/
@ 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:663
const Parameterised::Map & getACParametersMap() const
get parameters map
Definition: GNELane.cpp:875
PositionVector getAttributePositionVector(SumoXMLAttr key) const
Definition: GNELane.cpp:724
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
const GNELane * myLane
pointer to original lane
PositionVector getAttributePositionVector(SumoXMLAttr key) const
const Parameterised::Map & getACParametersMap() const
get parameters map
~GNELaneTemplate()
Destructor.
bool checkDrawDeleteContour() const
check if draw delete contour (pink/white)
GUIGlObject * getGUIGlObject()
get GUIGlObject associated with this AttributeCarrier
bool checkDrawRelatedContour() const
check if draw related contour (cyan)
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.
bool checkDrawSelectContour() const
check if draw select contour (blue)
bool checkDrawFromContour() const
check if draw from contour (green)
bool checkDrawToContour() const
check if draw from contour (magenta)
bool checkDrawMoveContour() const
check if draw move contour (red)
GNEHierarchicalElement * getHierarchicalElement()
get GNEHierarchicalElement associated with this AttributeCarrier
bool checkDrawOverContour() const
check if draw over contour (orange)
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
A list of positions.