Eclipse SUMO - Simulation of Urban MObility
GNETAZSourceSink.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 GNETAZSourceSink_h
17 #define GNETAZSourceSink_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include "GNEAdditional.h"
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
29 
30 class GNETAZ;
31 class GNETAZSink;
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
41 
42 public:
49  GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNEAdditional* TAZParent, GNEEdge* edge, double departWeight);
50 
53 
55  double getDepartWeight() const;
56 
59 
62  void moveGeometry(const Position& offset);
63 
67  void commitGeometryMoving(GNEUndoList* undoList);
68 
70  void updateGeometry();
71 
74 
77 
79  void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList);
81 
84 
87  std::string getParentName() const;
88 
93  void drawGL(const GUIVisualizationSettings& s) const;
95 
98  /* @brief method for getting the Attribute of an XML key
99  * @param[in] key The attribute key
100  * @return string with the value associated to key
101  */
102  std::string getAttribute(SumoXMLAttr key) const;
103 
104  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
105  * @param[in] key The attribute key
106  * @return double with the value associated to key
107  */
108  double getAttributeDouble(SumoXMLAttr key) const;
109 
110  /* @brief method for setting the attribute and letting the object perform additional changes
111  * @param[in] key The attribute key
112  * @param[in] value The new value
113  * @param[in] undoList The undoList on which to register changes
114  * @param[in] net optionally the GNENet to inform about gui updates
115  */
116  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
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  bool isValid(SumoXMLAttr key, const std::string& value);
124 
125  /* @brief method for check if the value for certain attribute is set
126  * @param[in] key The attribute key
127  */
128  bool isAttributeEnabled(SumoXMLAttr key) const;
129 
131  std::string getPopUpID() const;
132 
134  std::string getHierarchyName() const;
135 
137 
138 protected:
141 
142 private:
144  void setAttribute(SumoXMLAttr key, const std::string& value);
145 
148 
151 };
152 
153 #endif
154 
155 /****************************************************************************/
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNETAZSourceSink::GNETAZSourceSink
GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNEAdditional *TAZParent, GNEEdge *edge, double departWeight)
Constructor.
Definition: GNETAZSourceSink.cpp:34
GNEAdditional.h
GNETAZSourceSink::splitEdgeGeometry
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNETAZSourceSink.cpp:86
GNETAZSourceSink::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNETAZSourceSink.cpp:68
GNETAZSourceSink::~GNETAZSourceSink
~GNETAZSourceSink()
destructor
Definition: GNETAZSourceSink.cpp:46
GNETAZSourceSink::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNETAZSourceSink.cpp:80
GNETAZSourceSink::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNETAZSourceSink.cpp:62
GNETAZSourceSink::GNETAZSourceSink
GNETAZSourceSink(const GNETAZSourceSink &)=delete
Invalidated copy constructor.
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
GNETAZSourceSink::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNETAZSourceSink.cpp:175
GNETAZSourceSink::getAttribute
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
Definition: GNETAZSourceSink.cpp:104
GNETAZSourceSink::operator=
GNETAZSourceSink & operator=(const GNETAZSourceSink &)=delete
Invalidated assignment operator.
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNETAZSourceSink::getAttributeDouble
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNETAZSourceSink.cpp:142
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNETAZSourceSink::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNETAZSourceSink.cpp:56
GNETAZSourceSink::getParentName
std::string getParentName() const
Returns the name of the parent object.
Definition: GNETAZSourceSink.cpp:92
GNETAZ
Definition: GNETAZ.h:34
GNENetElement
Definition: GNENetElement.h:43
GNETAZSourceSink::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNETAZSourceSink.cpp:74
GNETAZSourceSink::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNETAZSourceSink.cpp:208
GNETAZSourceSink::getPopUpID
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNETAZSourceSink.cpp:202
GNETAZSourceSink::getDepartWeight
double getDepartWeight() const
get depart weight
Definition: GNETAZSourceSink.cpp:50
GNETAZSourceSink::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNETAZSourceSink.cpp:98
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
GNETAZSourceSink::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNETAZSourceSink.cpp:153
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNETAZSourceSink::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNETAZSourceSink.cpp:191
GNETAZSourceSink::myDepartWeight
double myDepartWeight
depart Weight
Definition: GNETAZSourceSink.h:140
GNETAZSourceSink
Definition: GNETAZSourceSink.h:40