Eclipse SUMO - Simulation of Urban MObility
GNEClosingReroute.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 //
15 /****************************************************************************/
16 #ifndef GNEClosingReroute_h
17 #define GNEClosingReroute_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include "GNEAdditional.h"
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
29 
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
41 
42 public:
44  GNEClosingReroute(GNERerouterIntervalDialog* rerouterIntervalDialog);
45 
47  GNEClosingReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions);
48 
51 
54 
57  void moveGeometry(const Position& offset);
58 
62  void commitGeometryMoving(GNEUndoList* undoList);
63 
65  void updateGeometry();
66 
69 
72 
74  void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList);
76 
79 
82  std::string getParentName() const;
83 
88  void drawGL(const GUIVisualizationSettings& s) const;
90 
93  /* @brief method for getting the Attribute of an XML key
94  * @param[in] key The attribute key
95  * @return string with the value associated to key
96  */
97  std::string getAttribute(SumoXMLAttr key) const;
98 
99  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
100  * @param[in] key The attribute key
101  * @return double with the value associated to key
102  */
103  double getAttributeDouble(SumoXMLAttr key) const;
104 
105  /* @brief method for setting the attribute and letting the object perform additional changes
106  * @param[in] key The attribute key
107  * @param[in] value The new value
108  * @param[in] undoList The undoList on which to register changes
109  */
110  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
111 
112  /* @brief method for checking if the key and their correspond attribute are valids
113  * @param[in] key The attribute key
114  * @param[in] value The value asociated to key key
115  * @return true if the value is valid, false in other case
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;
130 
131 protected:
134 
135  // @brief permissions of this Closing Reroute
137 
138 private:
140  void setAttribute(SumoXMLAttr key, const std::string& value);
141 
144 
147 };
148 
149 #endif
150 
151 /****************************************************************************/
GNEClosingReroute::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNEClosingReroute.cpp:170
GNEClosingReroute::myPermissions
SVCPermissions myPermissions
Definition: GNEClosingReroute.h:136
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNEAdditional.h
GNERerouterInterval
Definition: GNERerouterInterval.h:45
GNEClosingReroute::myClosedEdge
GNEEdge * myClosedEdge
closed edge
Definition: GNEClosingReroute.h:133
GNEClosingReroute::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEClosingReroute.cpp:151
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
GNEClosingReroute::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEClosingReroute.cpp:75
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
GNEClosingReroute
Definition: GNEClosingReroute.h:40
GNEClosingReroute::splitEdgeGeometry
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNEClosingReroute.cpp:87
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNEClosingReroute::~GNEClosingReroute
~GNEClosingReroute()
destructor
Definition: GNEClosingReroute.cpp:53
GNEClosingReroute::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEClosingReroute.cpp:105
GNEClosingReroute::getPopUpID
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNEClosingReroute.cpp:176
GNEClosingReroute::GNEClosingReroute
GNEClosingReroute(const GNEClosingReroute &)=delete
Invalidated copy constructor.
GNEClosingReroute::operator=
GNEClosingReroute & operator=(const GNEClosingReroute &)=delete
Invalidated assignment operator.
GNENetElement
Definition: GNENetElement.h:43
GNEClosingReroute::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNEClosingReroute.cpp:182
GNEClosingReroute::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNEClosingReroute.cpp:63
GNEClosingReroute::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEClosingReroute.cpp:99
GNEClosingReroute::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEClosingReroute.cpp:69
GNEClosingReroute::getAttributeDouble
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNEClosingReroute.cpp:126
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
GNEClosingReroute::GNEClosingReroute
GNEClosingReroute(GNERerouterIntervalDialog *rerouterIntervalDialog)
constructor (Used in GNERerouterIntervalDialog)
Definition: GNEClosingReroute.cpp:36
GNEClosingReroute::getParentName
std::string getParentName() const
Returns the name of the parent object.
Definition: GNEClosingReroute.cpp:93
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNEClosingReroute::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEClosingReroute.cpp:132
GNEClosingReroute::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEClosingReroute.cpp:81
GNERerouterIntervalDialog
Dialog for edit rerouter intervals.
Definition: GNERerouterIntervalDialog.h:49
GNEClosingReroute::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEClosingReroute.cpp:57