Eclipse SUMO - Simulation of Urban MObility
GNEVaporizer.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 //
15 /****************************************************************************/
16 #ifndef GNEVaporizer_h
17 #define GNEVaporizer_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include "GNEAdditional.h"
25 
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
34 class GNEVaporizer : public GNEAdditional {
35 
36 public:
44  GNEVaporizer(GNEViewNet* viewNet, GNEEdge* edge, SUMOTime begin, SUMOTime end, const std::string& name);
45 
47  ~GNEVaporizer();
48 
51 
54  void moveGeometry(const Position& offset);
55 
59  void commitGeometryMoving(GNEUndoList* undoList);
60 
62  void updateGeometry();
63 
66 
69 
71  void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList);
73 
78  std::string getParentName() const;
79 
84  void drawGL(const GUIVisualizationSettings& s) const;
86 
89  /* @brief method for getting the Attribute of an XML key
90  * @param[in] key The attribute key
91  * @return string with the value associated to key
92  */
93  std::string getAttribute(SumoXMLAttr key) const;
94 
95  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
96  * @param[in] key The attribute key
97  * @return double with the value associated to key
98  */
99  double getAttributeDouble(SumoXMLAttr key) const;
100 
101  /* @brief method for setting the attribute and letting the object perform additional changes
102  * @param[in] key The attribute key
103  * @param[in] value The new value
104  * @param[in] undoList The undoList on which to register changes
105  */
106  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
107 
108  /* @brief method for checking if the key and their correspond attribute are valids
109  * @param[in] key The attribute key
110  * @param[in] value The value asociated to key key
111  * @return true if the value is valid, false in other case
112  */
113  bool isValid(SumoXMLAttr key, const std::string& value);
114 
115  /* @brief method for check if the value for certain attribute is set
116  * @param[in] key The attribute key
117  */
118  bool isAttributeEnabled(SumoXMLAttr key) const;
119 
121  std::string getPopUpID() const;
122 
124  std::string getHierarchyName() const;
126 
127 protected:
130 
133 
134 private:
136  void setAttribute(SumoXMLAttr key, const std::string& value);
137 
139  GNEVaporizer(const GNEVaporizer&) = delete;
140 
143 };
144 
145 #endif
146 
147 /****************************************************************************/
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNEAdditional.h
GNEVaporizer::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEVaporizer.cpp:52
GNEVaporizer::getAttributeDouble
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNEVaporizer.cpp:225
GNEVaporizer::operator=
GNEVaporizer & operator=(const GNEVaporizer &)=delete
Invalidated assignment operator.
GNEVaporizer::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNEVaporizer.cpp:106
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
GNEViewNet
Definition: GNEViewNet.h:42
GNEVaporizer::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEVaporizer.cpp:203
GNEVaporizer::getPopUpID
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNEVaporizer.cpp:299
GNEVaporizer::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEVaporizer.cpp:100
GNEVaporizer::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEVaporizer.cpp:88
GNEVaporizer::myEnd
SUMOTime myEnd
end time in which this vaporizer is placed
Definition: GNEVaporizer.h:132
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNEVaporizer::getParentName
std::string getParentName() const
Returns the name of the parent object (if any)
Definition: GNEVaporizer.cpp:112
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNEVaporizer::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEVaporizer.cpp:118
GNENetElement
Definition: GNENetElement.h:43
GNEVaporizer::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEVaporizer.cpp:74
GNEVaporizer::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEVaporizer.cpp:259
GNEVaporizer::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNEVaporizer.cpp:305
GNEVaporizer::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNEVaporizer.cpp:293
GNEVaporizer::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEVaporizer.cpp:238
GNEVaporizer::myBegin
SUMOTime myBegin
begin time of vaporizer
Definition: GNEVaporizer.h:129
GNEVaporizer
Representation of a vaporizer in netedit.
Definition: GNEVaporizer.h:34
GNEVaporizer::splitEdgeGeometry
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNEVaporizer.cpp:94
GNEVaporizer::GNEVaporizer
GNEVaporizer(GNEViewNet *viewNet, GNEEdge *edge, SUMOTime begin, SUMOTime end, const std::string &name)
Constructor.
Definition: GNEVaporizer.cpp:38
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNEVaporizer::~GNEVaporizer
~GNEVaporizer()
Destructor.
Definition: GNEVaporizer.cpp:47
GNEVaporizer::GNEVaporizer
GNEVaporizer(const GNEVaporizer &)=delete
Invalidated copy constructor.