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 /****************************************************************************/
15 //
16 /****************************************************************************/
17 #ifndef GNEVariableSpeedSignStep_h
18 #define GNEVariableSpeedSignStep_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 
25 #include "GNEAdditional.h"
26 
27 // ===========================================================================
28 // class declarations
29 // ===========================================================================
30 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
42 
43 public:
45  GNEVariableSpeedSignStep(GNEVariableSpeedSignDialog* variableSpeedSignDialog);
46 
48  GNEVariableSpeedSignStep(GNEAdditional* variableSpeedSignParent, double time, double speed);
49 
52 
54  double getTime() const;
55 
58 
61  void moveGeometry(const Position& offset);
62 
66  void commitGeometryMoving(GNEUndoList* undoList);
67 
69  void updateGeometry();
70 
73 
77 
80 
83  std::string getParentName() const;
84 
89  void drawGL(const GUIVisualizationSettings& s) const;
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 setting the attribute and letting the object perform additional changes
101  * @param[in] key The attribute key
102  * @param[in] value The new value
103  * @param[in] undoList The undoList on which to register changes
104  * @param[in] net optionally the GNENet to inform about gui updates
105  */
106  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
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  */
113  bool isValid(SumoXMLAttr key, const std::string& value);
114 
116  std::string getPopUpID() const;
117 
119  std::string getHierarchyName() const;
121 
122 protected:
124  double myTime;
125 
127  double mySpeed;
128 
129 private:
131  void setAttribute(SumoXMLAttr key, const std::string& value);
132 
135 
138 };
139 
140 #endif
141 
142 /****************************************************************************/
GNEVariableSpeedSignStep::getPopUpID
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNEVariableSpeedSignStep.cpp:180
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:128
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
GNEAdditional.h
GNEVariableSpeedSignStep::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEVariableSpeedSignStep.cpp:103
GNEVariableSpeedSignStep
Definition: GNEVariableSpeedSignStep.h:41
GNEVariableSpeedSignStep::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNEVariableSpeedSignStep.cpp:186
GNEVariableSpeedSignStep::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEVariableSpeedSignStep.cpp:91
GNEVariableSpeedSign
Definition: GNEVariableSpeedSign.h:40
GNEVariableSpeedSignStep::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNEVariableSpeedSignStep.cpp:73
GNEVariableSpeedSignStep::~GNEVariableSpeedSignStep
~GNEVariableSpeedSignStep()
destructor
Definition: GNEVariableSpeedSignStep.cpp:57
GNEVariableSpeedSignStep::getParentName
std::string getParentName() const
Returns the name of the parent object.
Definition: GNEVariableSpeedSignStep.cpp:97
GNEVariableSpeedSignStep::GNEVariableSpeedSignStep
GNEVariableSpeedSignStep(GNEVariableSpeedSignDialog *variableSpeedSignDialog)
default constructor
Definition: GNEVariableSpeedSignStep.cpp:35
GNEVariableSpeedSignStep::myTime
double myTime
timeStep
Definition: GNEVariableSpeedSignStep.h:124
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNEVariableSpeedSignStep::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEVariableSpeedSignStep.cpp:67
GNEVariableSpeedSignStep::getAttribute
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
Definition: GNEVariableSpeedSignStep.cpp:109
GNEVariableSpeedSignDialog
Definition: GNEVariableSpeedSignDialog.h:45
GNEVariableSpeedSignStep::mySpeed
double mySpeed
speed in this timeStep
Definition: GNEVariableSpeedSignStep.h:127
GNEVariableSpeedSignStep::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEVariableSpeedSignStep.cpp:85
GNEVariableSpeedSignStep::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEVariableSpeedSignStep.cpp:79
GNEVariableSpeedSignStep::getTime
double getTime() const
get time
Definition: GNEVariableSpeedSignStep.cpp:61
GNEUndoList
Definition: GNEUndoList.h:49
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:373
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:146
GNEVariableSpeedSignStep::operator=
GNEVariableSpeedSignStep & operator=(const GNEVariableSpeedSignStep &)=delete
Invalidated assignment operator.