SUMO - Simulation of Urban MObility
GNEVariableSpeedSign.h
Go to the documentation of this file.
1 /****************************************************************************/
7 //
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEVariableSpeedSign_h
21 #define GNEVariableSpeedSign_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "GNEAdditional.h"
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
44 public:
45 
54  GNEVariableSpeedSign(const std::string& id, GNEViewNet* viewNet, Position pos, std::vector<GNELane*> lanes, const std::string& filename, const std::vector<GNEVariableSpeedSignStep>& vssValues);
55 
58 
63  void writeAdditional(OutputDevice& device, bool volatileOptionsEnabled) const;
64 
66  void openAdditionalDialog();
67 
69  const std::string& getFilename() const;
70 
72  const std::vector<GNEVariableSpeedSignStep>& getSteps() const;
73 
75  void setFilename(const std::string& filename);
76 
78  void setVariableSpeedSignSteps(const std::vector<GNEVariableSpeedSignStep>& steps);
79 
81  void addStep(const GNEVariableSpeedSignStep& step);
82 
85 
89  void moveGeometry(const Position& newPosition);
90 
95  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
96 
98  void updateGeometry();
99 
101  Position getPositionInView() const;
103 
106 
109  const std::string& getParentName() const;
110 
115  void drawGL(const GUIVisualizationSettings& s) const;
117 
120  /* @brief method for getting the Attribute of an XML key
121  * @param[in] key The attribute key
122  * @return string with the value associated to key
123  */
124  std::string getAttribute(SumoXMLAttr key) const;
125 
126  /* @brief method for setting the attribute and letting the object perform additional changes
127  * @param[in] key The attribute key
128  * @param[in] value The new value
129  * @param[in] undoList The undoList on which to register changes
130  */
131  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
132 
133  /* @brief method for checking if the key and their correspond attribute are valids
134  * @param[in] key The attribute key
135  * @param[in] value The value asociated to key key
136  * @return true if the value is valid, false in other case
137  */
138  bool isValid(SumoXMLAttr key, const std::string& value);
140 
141 protected:
144 
146  std::string myFilename;
147 
149  std::vector<GNEVariableSpeedSignStep> mySteps;
150 
153 
154 private:
156  void setAttribute(SumoXMLAttr key, const std::string& value);
157 
160 
163 };
164 
165 #endif
166 
167 /****************************************************************************/
const std::string & getParentName() const
Returns the name of the parent object.
GNEVariableSpeedSign(const std::string &id, GNEViewNet *viewNet, Position pos, std::vector< GNELane * > lanes, const std::string &filename, const std::vector< GNEVariableSpeedSignStep > &vssValues)
Constructor.
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
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
Position getPositionInView() const
Returns position of additional in view.
Stores the information about how to visualize structures.
void openAdditionalDialog()
open GNEVariableSpeedSignDialog
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const std::vector< GNEVariableSpeedSignStep > & getSteps() const
get values of variable speed signal
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
bool mySaveInFilename
enable or disable save in external filename
void setVariableSpeedSignSteps(const std::vector< GNEVariableSpeedSignStep > &steps)
set values of variable speed signal
void addStep(const GNEVariableSpeedSignStep &step)
insert a new step in variable speed signal
void updateGeometry()
update pre-computed geometry information
void moveGeometry(const Position &newPosition)
change the position of the element geometry without saving in undoList
GNEVariableSpeedSign & operator=(const GNEVariableSpeedSign &)
Invalidated assignment operator.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
const std::string & getFilename() const
get filename of variable speed sign
std::vector< GNEVariableSpeedSignStep > mySteps
values of variable speed signal
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:62
void setFilename(const std::string &filename)
set filename of variable speed sign
~GNEVariableSpeedSign()
Destructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
Position myPosition
position of VSS in view
std::string myFilename
filename of variable speed sign