SUMO - Simulation of Urban MObility
GNEVariableSpeedSign.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 //
18 /****************************************************************************/
19 #ifndef GNEVariableSpeedSign_h
20 #define GNEVariableSpeedSign_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "GNEAdditional.h"
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
48 
49 public:
50 
58  GNEVariableSpeedSign(const std::string& id, GNEViewNet* viewNet, Position pos, std::vector<GNELane*> lanes, const std::string& filename);
59 
62 
66  void writeAdditional(OutputDevice& device) const;
67 
69  void openAdditionalDialog();
70 
73 
76 
79 
81  const std::vector<GNEVariableSpeedSignStep*>& getVariableSpeedSignSteps() const;
82 
85 
87 
90 
94  void moveGeometry(const Position& oldPos, const Position& offset);
95 
100  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
101 
103  void updateGeometry();
104 
106  Position getPositionInView() const;
108 
111 
114  const std::string& getParentName() const;
115 
120  void drawGL(const GUIVisualizationSettings& s) const;
122 
125  /* @brief method for getting the Attribute of an XML key
126  * @param[in] key The attribute key
127  * @return string with the value associated to key
128  */
129  std::string getAttribute(SumoXMLAttr key) const;
130 
131  /* @brief method for setting the attribute and letting the object perform additional changes
132  * @param[in] key The attribute key
133  * @param[in] value The new value
134  * @param[in] undoList The undoList on which to register changes
135  */
136  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
137 
138  /* @brief method for checking if the key and their correspond attribute are valids
139  * @param[in] key The attribute key
140  * @param[in] value The value asociated to key key
141  * @return true if the value is valid, false in other case
142  */
143  bool isValid(SumoXMLAttr key, const std::string& value);
145 
146 protected:
149 
151  std::string myFilename;
152 
154  std::vector<GNEVariableSpeedSignStep*> mySteps;
155 
158 
159 private:
161  void setAttribute(SumoXMLAttr key, const std::string& value);
162 
165 
168 };
169 
170 #endif
171 
172 /****************************************************************************/
void sortVariableSpeedSignSteps()
sort steps
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
const std::vector< GNEVariableSpeedSignStep * > & getVariableSpeedSignSteps() const
get values of variable speed signal
void removeVariableSpeedSignStep(GNEVariableSpeedSignStep *step)
remove an existent step of variable speed signal
Stores the information about how to visualize structures.
void openAdditionalDialog()
open GNEVariableSpeedSignDialog
Position getPositionInView() const
Returns position of additional in view.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEVariableSpeedSign & operator=(const GNEVariableSpeedSign &)=delete
Invalidated assignment operator.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
bool mySaveInFilename
enable or disable save in external filename
void updateGeometry()
update pre-computed geometry information
std::vector< GNEVariableSpeedSignStep * > mySteps
values of variable speed signal
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:59
~GNEVariableSpeedSign()
Destructor.
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
GNEVariableSpeedSign(const std::string &id, GNEViewNet *viewNet, Position pos, std::vector< GNELane *> lanes, const std::string &filename)
Constructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
Position myPosition
position of VSS in view
std::string myFilename
filename of variable speed sign
const std::string & getParentName() const
Returns the name of the parent object.
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
void addVariableSpeedSignStep(GNEVariableSpeedSignStep *step)
insert a new step in variable speed signal