SUMO - Simulation of Urban MObility
GNEVaporizer.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 GNEVaporizer_h
21 #define GNEVaporizer_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 declarations
37 // ===========================================================================
38 
39 class GNEEdge;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
48 class GNEVaporizer : public GNEAdditional {
49 public:
56  GNEVaporizer(GNEViewNet* viewNet, GNEEdge* edge, double startTime, double end);
57 
59  ~GNEVaporizer();
60 
65  void writeAdditional(OutputDevice& device, bool volatileOptionsEnabled) const;
66 
69 
73  void moveGeometry(const Position& newPosition);
74 
79  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
80 
82  void updateGeometry();
83 
87 
91  void removeEdgeReference();
92 
94  double getStartTime() const;
95 
97  double getEnd() const;
98 
100  void setStartTime(double startTime);
101 
103  void setEndTime(double end);
104 
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:
143  double myStartTime;
144 
146  double myEnd;
147 
150 
153 
154 private:
156  void setAttribute(SumoXMLAttr key, const std::string& value);
157 
159  GNEVaporizer(const GNEVaporizer&);
160 
163 };
164 
165 #endif
166 
167 /****************************************************************************/
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
double myStartTime
start time of vaporizer
Definition: GNEVaporizer.h:143
int myRelativePositionY
relative position regarding to other route probes
Definition: GNEVaporizer.h:152
void setEndTime(double end)
set end
void setStartTime(double startTime)
set start time
Stores the information about how to visualize structures.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
GNEVaporizer & operator=(const GNEVaporizer &)
Invalidated assignment operator.
void moveGeometry(const Position &newPosition)
change the position of the element geometry without saving in undoList
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
Position getPositionInView() const
Returns position of additional in view.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:58
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:62
double myEnd
end time in which this vaporizer is placed
Definition: GNEVaporizer.h:146
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
double getEnd() const
get end
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
GNEVaporizer(GNEViewNet *viewNet, GNEEdge *edge, double startTime, double end)
Constructor.
void removeEdgeReference()
remove reference to edge
int myNumberOfLanes
number of lanes of edge (To improve efficiency)
Definition: GNEVaporizer.h:149
double getStartTime() const
get start time
~GNEVaporizer()
Destructor.
void updateGeometry()
update pre-computed geometry information
const std::string & getParentName() const
Returns the name of the parent object (if any)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.