SUMO - Simulation of Urban MObility
GNEVariableSpeedSignal.h
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 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 GNEVariableSpeedSignal_h
21 #define GNEVariableSpeedSignal_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 "GNEAdditionalSet.h"
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
43 public:
44 
54  GNEVariableSpeedSignal(const std::string& id, GNEViewNet* viewNet, Position pos, std::vector<GNELane*> lanes, const std::string& filename, const std::map<SUMOTime, SUMOReal>& VSSValues, bool blocked);
55 
58 
61  void updateGeometry();
62 
65 
67  void openAdditionalDialog();
68 
74  void moveAdditional(SUMOReal posx, SUMOReal posy, GNEUndoList* undoList);
75 
80  void writeAdditional(OutputDevice& device, const std::string& currentDirectory);
81 
83  std::string getFilename() const;
84 
86  std::map<SUMOTime, SUMOReal> getVariableSpeedSignalSteps() const;
87 
89  void setFilename(std::string filename);
90 
92  void setVariableSpeedSignalSteps(const std::map<SUMOTime, SUMOReal>& vssValues);
93 
96  bool insertStep(const SUMOTime time, const SUMOReal speed);
97 
102  const std::string& getParentName() const;
103 
108  void drawGL(const GUIVisualizationSettings& s) const;
110 
113  /* @brief method for getting the Attribute of an XML key
114  * @param[in] key The attribute key
115  * @return string with the value associated to key
116  */
117  std::string getAttribute(SumoXMLAttr key) const;
118 
119  /* @brief method for setting the attribute and letting the object perform additional changes
120  * @param[in] key The attribute key
121  * @param[in] value The new value
122  * @param[in] undoList The undoList on which to register changes
123  */
124  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
125 
126  /* @brief method for checking if the key and their correspond attribute are valids
127  * @param[in] key The attribute key
128  * @param[in] value The value asociated to key key
129  * @return true if the value is valid, false in other case
130  */
131  bool isValid(SumoXMLAttr key, const std::string& value);
133 
134 protected:
136  std::string myFilename;
137 
139  std::map<SUMOTime, SUMOReal> myVSSValues;
140 
143 
144 private:
146  void setAttribute(SumoXMLAttr key, const std::string& value);
147 
150 
153 };
154 
155 #endif
156 
157 /****************************************************************************/
std::string getFilename() const
get filename of rerouter
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
long long int SUMOTime
Definition: SUMOTime.h:43
void setFilename(std::string filename)
set filename of rerouter
GNEVariableSpeedSignal & operator=(const GNEVariableSpeedSignal &)
Invalidated assignment operator.
Stores the information about how to visualize structures.
Position getPositionInView() const
Returns position of Variable Speed Signal in view.
void updateGeometry()
update pre-computed geometry information
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void setVariableSpeedSignalSteps(const std::map< SUMOTime, SUMOReal > &vssValues)
set values of variable speed signal
An Element wich group additionalSet elements.
void writeAdditional(OutputDevice &device, const std::string &currentDirectory)
writte additional element into a xml file
std::string getAttribute(SumoXMLAttr key) const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
std::map< SUMOTime, SUMOReal > myVSSValues
values of variable speed signal
std::map< SUMOTime, SUMOReal > getVariableSpeedSignalSteps() const
get values of variable speed signal
bool isValid(SumoXMLAttr key, const std::string &value)
void moveAdditional(SUMOReal posx, SUMOReal posy, GNEUndoList *undoList)
change the position of the rerouter geometry
std::string myFilename
filename of rerouter
GNEVariableSpeedSignal(const std::string &id, GNEViewNet *viewNet, Position pos, std::vector< GNELane * > lanes, const std::string &filename, const std::map< SUMOTime, SUMOReal > &VSSValues, bool blocked)
Constructor.
const std::string & getParentName() const
Returns the name of the parent object (if any)
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:213
void openAdditionalDialog()
open GNEVariableSpeedSignalDialog
bool insertStep(const SUMOTime time, const SUMOReal speed)
insert a new step in variable speed signal
bool mySaveInFilename
enable or disable save in external filename