Eclipse SUMO - Simulation of Urban MObility
GNEClosingLaneReroute.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-2020 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 //
19 /****************************************************************************/
20 #pragma once
21 #include "GNEAdditional.h"
22 
23 // ===========================================================================
24 // class declarations
25 // ===========================================================================
26 
27 class GNELane;
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
39 
40 public:
42  GNEClosingLaneReroute(GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions);
43 
46 
50  GNEMoveOperation* getMoveOperation(const double shapeOffset);
51 
55  void updateGeometry();
56 
58  void updateCenteringBoundary(const bool updateGrid);
59 
61  void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
63 
66 
69  std::string getParentName() const;
70 
75  void drawGL(const GUIVisualizationSettings& s) const;
77 
80  /* @brief method for getting the Attribute of an XML key
81  * @param[in] key The attribute key
82  * @return string with the value associated to key
83  */
84  std::string getAttribute(SumoXMLAttr key) const;
85 
86  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
87  * @param[in] key The attribute key
88  * @return double with the value associated to key
89  */
90  double getAttributeDouble(SumoXMLAttr key) const;
91 
92  /* @brief method for setting the attribute and letting the object perform additional changes
93  * @param[in] key The attribute key
94  * @param[in] value The new value
95  * @param[in] undoList The undoList on which to register changes
96  */
97  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
98 
99  /* @brief method for checking if the key and their correspond attribute are valids
100  * @param[in] key The attribute key
101  * @param[in] value The value asociated to key key
102  * @return true if the value is valid, false in other case
103  */
104  bool isValid(SumoXMLAttr key, const std::string& value);
105 
106  /* @brief method for check if the value for certain attribute is set
107  * @param[in] key The attribute key
108  */
109  bool isAttributeEnabled(SumoXMLAttr key) const;
110 
112  std::string getPopUpID() const;
113 
115  std::string getHierarchyName() const;
117 
118 protected:
121 
122  // @brief Permissions of This Closing Lane Reroute
124 
125 private:
127  void setAttribute(SumoXMLAttr key, const std::string& value);
128 
130  void setMoveShape(const GNEMoveResult& moveResult);
131 
133  void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
134 
137 
140 };
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
bool isAttributeEnabled(SumoXMLAttr key) const
GNEClosingLaneReroute & operator=(const GNEClosingLaneReroute &)=delete
Invalidated assignment operator.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
double getAttributeDouble(SumoXMLAttr key) const
std::string getParentName() const
Returns the name of the parent object.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
void updateGeometry()
update pre-computed geometry information
GNELane * myClosedLane
closed lane
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
GNEClosingLaneReroute(GNEAdditional *rerouterIntervalParent, GNELane *closedLane, SVCPermissions permissions)
parameter constructor
std::string getAttribute(SumoXMLAttr key) const
GNEClosingLaneReroute(const GNEClosingLaneReroute &)=delete
Invalidated copy constructor.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
move operation
move result
Dialog for edit rerouter intervals.
Stores the information about how to visualize structures.