Eclipse SUMO - Simulation of Urban MObility
GNERerouterInterval.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 GNERerouterInterval_h
17 #define GNERerouterInterval_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include "GNEAdditional.h"
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
29 
30 class GNERerouter;
31 class GNERerouterDialog;
33 class GNEClosingReroute;
34 class GNEDestProbReroute;
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
46 
47 public:
49  GNERerouterInterval(GNERerouterDialog* rerouterDialog);
50 
52  GNERerouterInterval(GNEAdditional* rerouterParent, SUMOTime begin, SUMOTime end);
53 
56 
59 
62  void moveGeometry(const Position& offset);
63 
67  void commitGeometryMoving(GNEUndoList* undoList);
68 
70  void updateGeometry();
71 
74 
77 
79  void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList);
81 
84 
87  std::string getParentName() const;
88 
93  void drawGL(const GUIVisualizationSettings& s) const;
95 
98  /* @brief method for getting the Attribute of an XML key
99  * @param[in] key The attribute key
100  * @return string with the value associated to key
101  */
102  std::string getAttribute(SumoXMLAttr key) const;
103 
104  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
105  * @param[in] key The attribute key
106  * @return double with the value associated to key
107  */
108  double getAttributeDouble(SumoXMLAttr key) const;
109 
110  /* @brief method for setting the attribute and letting the object perform additional changes
111  * @param[in] key The attribute key
112  * @param[in] value The new value
113  * @param[in] undoList The undoList on which to register changes
114  */
115  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
116 
117  /* @brief method for checking if the key and their correspond attribute are valids
118  * @param[in] key The attribute key
119  * @param[in] value The value asociated to key key
120  * @return true if the value is valid, false in other case
121  */
122  bool isValid(SumoXMLAttr key, const std::string& value);
123 
124  /* @brief method for check if the value for certain attribute is set
125  * @param[in] key The attribute key
126  */
127  bool isAttributeEnabled(SumoXMLAttr key) const;
128 
130  std::string getPopUpID() const;
131 
133  std::string getHierarchyName() const;
135 
136 protected:
139 
142 
143 private:
145  void setAttribute(SumoXMLAttr key, const std::string& value);
146 
149 
152 };
153 
154 #endif
155 
156 /****************************************************************************/
GNERerouterInterval::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNERerouterInterval.cpp:175
GNERerouterInterval::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNERerouterInterval.cpp:132
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNEAdditional.h
GNERerouterInterval::~GNERerouterInterval
~GNERerouterInterval()
destructor
Definition: GNERerouterInterval.cpp:49
GNERerouterInterval
Definition: GNERerouterInterval.h:45
GNERerouterInterval::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNERerouterInterval.cpp:58
GNERerouterDialog
Dialog for edit rerouters.
Definition: GNERerouterDialog.h:44
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
GNERerouterInterval::getParentName
std::string getParentName() const
Returns the name of the parent object.
Definition: GNERerouterInterval.cpp:88
GNERerouterInterval::getAttributeDouble
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNERerouterInterval.cpp:119
GNERerouterInterval::GNERerouterInterval
GNERerouterInterval(GNERerouterDialog *rerouterDialog)
constructor (Used in GNERerouterDialog)
Definition: GNERerouterInterval.cpp:33
GNERerouter
Definition: GNERerouter.h:39
GNERerouterInterval::myEnd
SUMOTime myEnd
end timeStep
Definition: GNERerouterInterval.h:141
GNERerouterInterval::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNERerouterInterval.cpp:64
GNERerouterInterval::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNERerouterInterval.cpp:94
GNERerouterInterval::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNERerouterInterval.cpp:76
GNERerouterInterval::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNERerouterInterval.cpp:100
GNERerouterInterval::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNERerouterInterval.cpp:187
GNERerouterInterval::splitEdgeGeometry
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNERerouterInterval.cpp:82
GNERerouterInterval::myBegin
SUMOTime myBegin
begin timeStep
Definition: GNERerouterInterval.h:138
GNEClosingReroute
Definition: GNEClosingReroute.h:40
GNERouteProbReroute
Definition: GNERouteProbReroute.h:42
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNERerouterInterval::operator=
GNERerouterInterval & operator=(GNERerouterInterval *)=delete
Invalidated assignment operator.
GNERerouterInterval::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNERerouterInterval.cpp:70
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNENetElement
Definition: GNENetElement.h:43
GNERerouterInterval::getPopUpID
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNERerouterInterval.cpp:181
GNERerouterInterval::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNERerouterInterval.cpp:158
GNEClosingLaneReroute
Definition: GNEClosingLaneReroute.h:41
GNERerouterInterval::GNERerouterInterval
GNERerouterInterval(GNERerouterInterval *)=delete
Invalidated copy constructor.
GNEDestProbReroute
Definition: GNEDestProbReroute.h:41
GNERerouterInterval::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNERerouterInterval.cpp:52
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNEParkingAreaReroute
Definition: GNEParkingAreaReroute.h:42