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"
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 
61  void updateGeometry();
62 
65 
67  void openAdditionalDialog();
68 
70  void moveAdditionalGeometry(double offsetx, double offsety);
71 
73  void commmitAdditionalGeometryMoved(double oldPosx, double oldPosy, GNEUndoList* undoList);
74 
79  void writeAdditional(OutputDevice& device) const;
80 
82  const std::string& getFilename() const;
83 
85  const std::vector<GNEVariableSpeedSignStep>& getSteps() const;
86 
88  void setFilename(const std::string& filename);
89 
91  void setVariableSpeedSignSteps(const std::vector<GNEVariableSpeedSignStep>& steps);
92 
94  void addStep(const GNEVariableSpeedSignStep& step);
95 
98 
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::vector<GNEVariableSpeedSignStep> mySteps;
139 
142 
143 private:
145  void setAttribute(SumoXMLAttr key, const std::string& value);
146 
149 
152 };
153 
154 #endif
155 
156 /****************************************************************************/
const std::string & getFilename() const
get filename of variable speed sign
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Stores the information about how to visualize structures.
void openAdditionalDialog()
open GNEVariableSpeedSignDialog
Position getPositionInView() const
Returns position of Variable Speed Signal in view.
void commmitAdditionalGeometryMoved(double oldPosx, double oldPosy, GNEUndoList *undoList)
updated geometry changes in the attributes of additional
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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 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
std::string getAttribute(SumoXMLAttr key) const
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 ...
GNEVariableSpeedSign(const std::string &id, GNEViewNet *viewNet, Position pos, std::vector< GNELane *> lanes, const std::string &filename, const std::vector< GNEVariableSpeedSignStep > &vssValues)
Constructor.
const std::vector< GNEVariableSpeedSignStep > & getSteps() const
get values of variable speed signal
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
std::string myFilename
filename of variable speed sign
void moveAdditionalGeometry(double offsetx, double offsety)
change the position of the variable speed sign geometry
const std::string & getParentName() const
Returns the name of the parent object.
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file