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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 //
19 /****************************************************************************/
20 #pragma once
21 #include "GNETAZElement.h"
22 
23 
24 // ===========================================================================
25 // class definitions
26 // ===========================================================================
32 
33 public:
40  GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNETAZElement* TAZParent, GNEEdge* edge, double departWeight);
41 
44 
46  const PositionVector& getTAZElementShape() const;
47 
51  void writeTAZElement(OutputDevice& device) const;
52 
54  double getDepartWeight() const;
55 
59  void updateGeometry();
60 
63 
66 
68  void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
70 
73 
76  std::string getParentName() const;
77 
82  void drawGL(const GUIVisualizationSettings& s) const;
84 
87  /* @brief method for getting the Attribute of an XML key
88  * @param[in] key The attribute key
89  * @return string with the value associated to key
90  */
91  std::string getAttribute(SumoXMLAttr key) const;
92 
93  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
94  * @param[in] key The attribute key
95  * @return double with the value associated to key
96  */
97  double getAttributeDouble(SumoXMLAttr key) const;
98 
99  /* @brief method for setting the attribute and letting the object perform additional changes
100  * @param[in] key The attribute key
101  * @param[in] value The new value
102  * @param[in] undoList The undoList on which to register changes
103  * @param[in] net optionally the GNENet to inform about gui updates
104  */
105  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
106 
107  /* @brief method for setting the attribute and letting the object perform additional changes
108  * @param[in] key The attribute key
109  * @param[in] value The new value
110  * @param[in] undoList The undoList on which to register changes
111  */
112  bool isValid(SumoXMLAttr key, const std::string& value);
113 
114  /* @brief method for check if the value for certain attribute is set
115  * @param[in] key The attribute key
116  */
117  bool isAttributeEnabled(SumoXMLAttr key) const;
118 
120  std::string getPopUpID() const;
121 
123  std::string getHierarchyName() const;
125 
126 protected:
129 
130 private:
132  void setAttribute(SumoXMLAttr key, const std::string& value);
133 
136 
139 };
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNETAZElement.h:45
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void updateGeometry()
update pre-computed geometry information
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform TAZElement changes
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void writeTAZElement(OutputDevice &device) const
writte TAZElement element into a xml file
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
double getDepartWeight() const
get depart weight
~GNETAZSourceSink()
destructor
double myDepartWeight
depart Weight
GNETAZSourceSink(const GNETAZSourceSink &)=delete
Invalidated copy constructor.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
GNETAZSourceSink & operator=(const GNETAZSourceSink &)=delete
Invalidated assignment operator.
std::string getParentName() const
Returns the name of the parent object.
GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNETAZElement *TAZParent, GNEEdge *edge, double departWeight)
Constructor.
double getAttributeDouble(SumoXMLAttr key) const
const PositionVector & getTAZElementShape() const
get TAZ Shape
bool isAttributeEnabled(SumoXMLAttr key) const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Position getPositionInView() const
Returns position of additional in view.
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:60
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36
A list of positions.