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-2022 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 <config.h>
22 #include "GNETAZElement.h"
23 
24 
25 // ===========================================================================
26 // class definitions
27 // ===========================================================================
33 
34 public:
37 
44  GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNETAZElement* TAZParent, GNEEdge* edge, double departWeight);
45 
48 
50  const PositionVector& getTAZElementShape() const;
51 
55  void writeTAZElement(OutputDevice& device) const;
56 
58  double getDepartWeight() const;
59 
63  void updateGeometry();
64 
67 
69  double getExaggeration(const GUIVisualizationSettings& s) const;
70 
73 
75  void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
77 
80 
83  std::string getParentName() const;
84 
93 
98  void drawGL(const GUIVisualizationSettings& s) const;
100 
103  /* @brief method for getting the Attribute of an XML key
104  * @param[in] key The attribute key
105  * @return string with the value associated to key
106  */
107  std::string getAttribute(SumoXMLAttr key) const;
108 
109  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
110  * @param[in] key The attribute key
111  * @return double with the value associated to key
112  */
113  double getAttributeDouble(SumoXMLAttr key) const;
114 
115  /* @brief method for getting the Attribute of an XML key in position format (to avoid unnecessary parse<position>(...) for certain attributes)
116  * @param[in] key The attribute key
117  * @return double with the value associated to key
118  */
120 
121  /* @brief method for setting the attribute and letting the object perform additional changes
122  * @param[in] key The attribute key
123  * @param[in] value The new value
124  * @param[in] undoList The undoList on which to register changes
125  * @param[in] net optionally the GNENet to inform about gui updates
126  */
127  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
128 
129  /* @brief method for setting the attribute and letting the object perform additional changes
130  * @param[in] key The attribute key
131  * @param[in] value The new value
132  * @param[in] undoList The undoList on which to register changes
133  */
134  bool isValid(SumoXMLAttr key, const std::string& value);
135 
136  /* @brief method for check if the value for certain attribute is set
137  * @param[in] key The attribute key
138  */
139  bool isAttributeEnabled(SumoXMLAttr key) const;
140 
142  std::string getPopUpID() const;
143 
145  std::string getHierarchyName() const;
147 
148 protected:
151 
152 private:
154  void setAttribute(SumoXMLAttr key, const std::string& value);
155 
158 
161 };
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:53
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
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
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
double myDepartWeight
depart Weight
GNETAZSourceSink(const GNETAZSourceSink &)=delete
Invalidated copy constructor.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
GNETAZSourceSink(SumoXMLTag tag, GNENet *net)
default Constructor
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.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
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.
Position getAttributePosition(SumoXMLAttr key) const
The popup menu of a globject.
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
A list of positions.