Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEEdgeTemplate.h
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#pragma once
21#include <config.h>
22
24
25// ===========================================================================
26// class declarations
27// ===========================================================================
28class GNEEdge;
29class GNELaneTemplate;
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
35
36public:
38 GNEEdgeTemplate(const GNEEdge* edge);
39
42
45
47 const std::vector<GNELaneTemplate*>& getLaneTemplates() const;
48
51
54
57
59 const GUIGlObject* getGUIGlObject() const;
60
62 void updateGeometry();
63
65
68
70 bool checkDrawFromContour() const;
71
73 bool checkDrawToContour() const;
74
76 bool checkDrawRelatedContour() const;
77
79 bool checkDrawOverContour() const;
80
82 bool checkDrawDeleteContour() const;
83
85 bool checkDrawSelectContour() const;
86
88 bool checkDrawMoveContour() const;
89
91
94 /* @brief method for getting the Attribute of an XML key
95 * @param[in] key The attribute key
96 * @return string with the value associated to key
97 */
98 std::string getAttribute(SumoXMLAttr key) const;
99
100 /* @brief method for getting the Attribute of an XML key in Position format
101 * @param[in] key The attribute key
102 * @return position with the value associated to key
103 */
105
106 /* @brief method for setting the attribute and letting the object perform additional changes
107 * @param[in] key The attribute key
108 * @param[in] value The new value
109 * @param[in] undoList The undoList on which to register changes
110 */
111 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
112
113 /* @brief method for check if new value for certain attribute is valid
114 * @param[in] key The attribute key
115 * @param[in] value The new value
116 */
117 bool isValid(SumoXMLAttr key, const std::string& value);
118
119 /* @brief method for check if the value for certain attribute is set
120 * @param[in] key The attribute key
121 */
122 bool isAttributeEnabled(SumoXMLAttr key) const;
123
125 std::string getPopUpID() const;
126
128 std::string getHierarchyName() const;
129
131
134
135protected:
138
140 std::vector<GNELaneTemplate*> myLaneTemplates;
141
142private:
144 void setAttribute(SumoXMLAttr key, const std::string& value);
145
148
151};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
bool isAttributeEnabled(SumoXMLAttr key) const
~GNEEdgeTemplate()
Destructor.
GNEEdgeTemplate(const GNEEdgeTemplate &s)=delete
invalidated copy constructor
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
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
GNEEdgeTemplate & operator=(const GNEEdgeTemplate &s)=delete
invalidated assignment operator
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::map< std::string, std::string > Map
parameters map
A list of positions.