SUMO - Simulation of Urban MObility
GNEVariableSpeedSign.h
Go to the documentation of this file.
1 /****************************************************************************/
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"
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
43 public:
44 
53  GNEVariableSpeedSign(const std::string& id, GNEViewNet* viewNet, Position pos, std::vector<GNELane*> lanes, const std::string& filename, const std::map<SUMOReal, SUMOReal>& vssValues);
54 
57 
60  void updateGeometry();
61 
64 
66  void openAdditionalDialog();
67 
69  void moveAdditionalGeometry(SUMOReal offsetx, SUMOReal offsety);
70 
72  void commmitAdditionalGeometryMoved(SUMOReal oldPosx, SUMOReal oldPosy, GNEUndoList* undoList);
73 
78  void writeAdditional(OutputDevice& device) const;
79 
81  std::string getFilename() const;
82 
84  std::map<SUMOReal, SUMOReal> getVariableSpeedSignSteps() const;
85 
87  void setFilename(std::string filename);
88 
90  void setVariableSpeedSignSteps(const std::map<SUMOReal, SUMOReal>& vssValues);
91 
94  bool insertStep(const SUMOReal time, const SUMOReal speed);
95 
100  const std::string& getParentName() const;
101 
106  void drawGL(const GUIVisualizationSettings& s) const;
108 
111  /* @brief method for getting the Attribute of an XML key
112  * @param[in] key The attribute key
113  * @return string with the value associated to key
114  */
115  std::string getAttribute(SumoXMLAttr key) const;
116 
117  /* @brief method for setting the attribute and letting the object perform additional changes
118  * @param[in] key The attribute key
119  * @param[in] value The new value
120  * @param[in] undoList The undoList on which to register changes
121  */
122  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
123 
124  /* @brief method for checking if the key and their correspond attribute are valids
125  * @param[in] key The attribute key
126  * @param[in] value The value asociated to key key
127  * @return true if the value is valid, false in other case
128  */
129  bool isValid(SumoXMLAttr key, const std::string& value);
131 
132 protected:
134  std::string myFilename;
135 
137  std::map<SUMOReal, SUMOReal> myVSSValues;
138 
141 
142 private:
144  void setAttribute(SumoXMLAttr key, const std::string& value);
145 
148 
151 };
152 
153 #endif
154 
155 /****************************************************************************/
bool insertStep(const SUMOReal time, const SUMOReal speed)
insert a new step in variable speed signal
void moveAdditionalGeometry(SUMOReal offsetx, SUMOReal offsety)
change the position of the rerouter geometry
std::map< SUMOReal, SUMOReal > getVariableSpeedSignSteps() const
get values of variable speed signal
const std::string & getParentName() const
Returns the name of the parent object (if any)
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
GNEVariableSpeedSign(const std::string &id, GNEViewNet *viewNet, Position pos, std::vector< GNELane * > lanes, const std::string &filename, const std::map< SUMOReal, SUMOReal > &vssValues)
Constructor.
std::map< SUMOReal, SUMOReal > myVSSValues
values of variable speed signal
Position getPositionInView() const
Returns position of Variable Speed Signal in view.
Stores the information about how to visualize structures.
void openAdditionalDialog()
open GNEVariableSpeedSignDialog
std::string getFilename() const
get filename of rerouter
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void setFilename(std::string filename)
set filename of rerouter
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
void setVariableSpeedSignSteps(const std::map< SUMOReal, SUMOReal > &vssValues)
set values of variable speed signal
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
bool mySaveInFilename
enable or disable save in external filename
void updateGeometry()
update pre-computed geometry information
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 ...
void commmitAdditionalGeometryMoved(SUMOReal oldPosx, SUMOReal oldPosy, GNEUndoList *undoList)
updated geometry changes in the attributes of additional
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:62
~GNEVariableSpeedSign()
Destructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:208
std::string myFilename
filename of rerouter