Eclipse SUMO - Simulation of Urban MObility
GNEVariableSpeedSignStep.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 GNEVariableSpeedSignStep_h
17 #define GNEVariableSpeedSignStep_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  GNEVariableSpeedSignStep(GNEVariableSpeedSignDialog* variableSpeedSignDialog);
45 
47  GNEVariableSpeedSignStep(GNEAdditional* variableSpeedSignParent, double time, double speed);
48 
51 
53  double getTime() const;
54 
57 
60  void moveGeometry(const Position& offset);
61 
65  void commitGeometryMoving(GNEUndoList* undoList);
66 
68  void updateGeometry();
69 
72 
75 
77  void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList);
79 
82 
85  std::string getParentName() const;
86 
91  void drawGL(const GUIVisualizationSettings& s) const;
93 
96  /* @brief method for getting the Attribute of an XML key
97  * @param[in] key The attribute key
98  * @return string with the value associated to key
99  */
100  std::string getAttribute(SumoXMLAttr key) const;
101 
102  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
103  * @param[in] key The attribute key
104  * @return double with the value associated to key
105  */
106  double getAttributeDouble(SumoXMLAttr key) const;
107 
108  /* @brief method for setting the attribute and letting the object perform additional changes
109  * @param[in] key The attribute key
110  * @param[in] value The new value
111  * @param[in] undoList The undoList on which to register changes
112  * @param[in] net optionally the GNENet to inform about gui updates
113  */
114  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
115 
116  /* @brief method for setting the attribute and letting the object perform additional changes
117  * @param[in] key The attribute key
118  * @param[in] value The new value
119  * @param[in] undoList The undoList on which to register changes
120  */
121  bool isValid(SumoXMLAttr key, const std::string& value);
122 
123  /* @brief method for check if the value for certain attribute is set
124  * @param[in] key The attribute key
125  */
126  bool isAttributeEnabled(SumoXMLAttr key) const;
127 
129  std::string getPopUpID() const;
130 
132  std::string getHierarchyName() const;
134 
135 protected:
137  double myTime;
138 
140  double mySpeed;
141 
142 private:
144  void setAttribute(SumoXMLAttr key, const std::string& value);
145 
148 
151 };
152 
153 #endif
154 
155 /****************************************************************************/
GNEVariableSpeedSignStep::getPopUpID
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNEVariableSpeedSignStep.cpp:202
GNEVariableSpeedSignStep::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEVariableSpeedSignStep.cpp:144
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNEAdditional.h
GNEVariableSpeedSignStep::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEVariableSpeedSignStep.cpp:108
GNEVariableSpeedSignStep
Definition: GNEVariableSpeedSignStep.h:40
GNEVariableSpeedSignStep::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNEVariableSpeedSignStep.cpp:208
GNEVariableSpeedSignStep::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEVariableSpeedSignStep.cpp:90
GNEVariableSpeedSign
Definition: GNEVariableSpeedSign.h:39
GNEVariableSpeedSignStep::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNEVariableSpeedSignStep.cpp:72
GNEVariableSpeedSignStep::~GNEVariableSpeedSignStep
~GNEVariableSpeedSignStep()
destructor
Definition: GNEVariableSpeedSignStep.cpp:56
GNEVariableSpeedSignStep::getParentName
std::string getParentName() const
Returns the name of the parent object.
Definition: GNEVariableSpeedSignStep.cpp:102
GNEVariableSpeedSignStep::GNEVariableSpeedSignStep
GNEVariableSpeedSignStep(GNEVariableSpeedSignDialog *variableSpeedSignDialog)
default constructor
Definition: GNEVariableSpeedSignStep.cpp:34
GNEVariableSpeedSignStep::splitEdgeGeometry
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNEVariableSpeedSignStep.cpp:96
GNEVariableSpeedSignStep::myTime
double myTime
timeStep
Definition: GNEVariableSpeedSignStep.h:137
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNEVariableSpeedSignStep::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNEVariableSpeedSignStep.cpp:196
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNEVariableSpeedSignStep::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEVariableSpeedSignStep.cpp:66
GNENetElement
Definition: GNENetElement.h:43
GNEVariableSpeedSignStep::getAttribute
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
Definition: GNEVariableSpeedSignStep.cpp:114
GNEVariableSpeedSignDialog
Definition: GNEVariableSpeedSignDialog.h:44
GNEVariableSpeedSignStep::getAttributeDouble
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNEVariableSpeedSignStep.cpp:133
GNEVariableSpeedSignStep::mySpeed
double mySpeed
speed in this timeStep
Definition: GNEVariableSpeedSignStep.h:140
GNEVariableSpeedSignStep::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEVariableSpeedSignStep.cpp:84
GNEVariableSpeedSignStep::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEVariableSpeedSignStep.cpp:78
GNEVariableSpeedSignStep::getTime
double getTime() const
get time
Definition: GNEVariableSpeedSignStep.cpp:60
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
GNEVariableSpeedSignStep::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEVariableSpeedSignStep.cpp:162
GNEVariableSpeedSignStep::operator=
GNEVariableSpeedSignStep & operator=(const GNEVariableSpeedSignStep &)=delete
Invalidated assignment operator.