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 
70  void moveAdditionalGeometry(SUMOReal offsetx, SUMOReal offsety);
71 
73  void commmitAdditionalGeometryMoved(SUMOReal oldPosx, SUMOReal oldPosy, GNEUndoList* undoList);
74 
79  void writeAdditional(OutputDevice& device, const std::string& currentDirectory);
80 
82  std::string getFilename() const;
83 
85  std::map<SUMOTime, SUMOReal> getVariableSpeedSignalSteps() const;
86 
88  void setFilename(std::string filename);
89 
91  void setVariableSpeedSignalSteps(const std::map<SUMOTime, SUMOReal>& vssValues);
92 
95  bool insertStep(const SUMOTime time, const SUMOReal speed);
96 
101  const std::string& getParentName() const;
102 
107  void drawGL(const GUIVisualizationSettings& s) const;
109 
112  /* @brief method for getting the Attribute of an XML key
113  * @param[in] key The attribute key
114  * @return string with the value associated to key
115  */
116  std::string getAttribute(SumoXMLAttr key) const;
117 
118  /* @brief method for setting the attribute and letting the object perform additional changes
119  * @param[in] key The attribute key
120  * @param[in] value The new value
121  * @param[in] undoList The undoList on which to register changes
122  */
123  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
124 
125  /* @brief method for checking if the key and their correspond attribute are valids
126  * @param[in] key The attribute key
127  * @param[in] value The value asociated to key key
128  * @return true if the value is valid, false in other case
129  */
130  bool isValid(SumoXMLAttr key, const std::string& value);
132 
133 protected:
135  std::string myFilename;
136 
138  std::map<SUMOTime, SUMOReal> myVSSValues;
139 
142 
143 private:
145  void setAttribute(SumoXMLAttr key, const std::string& value);
146 
149 
152 };
153 
154 #endif
155 
156 /****************************************************************************/
std::string getAttribute(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
long long int SUMOTime
Definition: SUMOTime.h:43
std::map< SUMOTime, SUMOReal > getVariableSpeedSignalSteps() const
get values of variable speed signal
void moveAdditionalGeometry(SUMOReal offsetx, SUMOReal offsety)
change the position of the rerouter geometry
void setFilename(std::string filename)
set filename of rerouter
GNEVariableSpeedSignal & operator=(const GNEVariableSpeedSignal &)
Invalidated assignment operator.
Stores the information about how to visualize structures.
void updateGeometry()
update pre-computed geometry information
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Position getPositionInView() const
Returns position of Variable Speed Signal in view.
void setVariableSpeedSignalSteps(const std::map< SUMOTime, SUMOReal > &vssValues)
set values of variable speed signal
void commmitAdditionalGeometryMoved(SUMOReal oldPosx, SUMOReal oldPosy, GNEUndoList *undoList)
updated geometry changes in the attributes of additional
An Element wich group additionalSet elements.
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.
void writeAdditional(OutputDevice &device, const std::string &currentDirectory)
writte additional element into a xml file
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
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 getFilename() const
get filename of rerouter
std::string myFilename
filename of rerouter
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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