Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GNETAZSourceSink.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 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
23#include "GNEAdditional.h"
24
27
28// ===========================================================================
29// class definitions
30// ===========================================================================
31
33
34public:
36 GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNENet* net);
37
44 GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNEAdditional* TAZParent, GNEEdge* edge, const double departWeight);
45
48
51
53 void writeTAZSourceSink(OutputDevice& device) const;
54
56 double getWeight() const;
57
62
64 const GUIGlObject* getGUIGlObject() const;
65
67 void updateGeometry();
68
70
73
75 bool checkDrawFromContour() const;
76
78 bool checkDrawToContour() const;
79
81 bool checkDrawRelatedContour() const;
82
84 bool checkDrawOverContour() const;
85
87 bool checkDrawDeleteContour() const;
88
90 bool checkDrawDeleteContourSmall() const;
91
93 bool checkDrawSelectContour() const;
94
96 bool checkDrawMoveContour() const;
97
99
102
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
117
118 /* @brief method for getting the Attribute of an XML key in position format (to avoid unnecessary parse<position>(...) for certain attributes)
119 * @param[in] key The attribute key
120 * @return double with the value associated to key
121 */
123
124 /* @brief method for setting the attribute and letting the object perform additional changes
125 * @param[in] key The attribute key
126 * @param[in] value The new value
127 * @param[in] undoList The undoList on which to register changes
128 * @param[in] net optionally the GNENet to inform about gui updates
129 */
130 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
131
132 /* @brief method for setting the attribute and letting the object perform additional changes
133 * @param[in] key The attribute key
134 * @param[in] value The new value
135 * @param[in] undoList The undoList on which to register changes
136 */
137 bool isValid(SumoXMLAttr key, const std::string& value);
138
139 /* @brief method for check if the value for certain attribute is set
140 * @param[in] key The attribute key
141 */
142 bool isAttributeEnabled(SumoXMLAttr key) const;
143
145 std::string getPopUpID() const;
146
148 std::string getHierarchyName() const;
149
151
152protected:
154 double myWeight = 0;
155
156private:
158 void setAttribute(SumoXMLAttr key, const std::string& value);
159
161 void setMoveShape(const GNEMoveResult& moveResult);
162
164 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
165
168
171};
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
bool isValid(SumoXMLAttr key, const std::string &value)
void updateGeometry()
update pre-computed geometry information
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
double getWeight() const
get weight
GNETAZSourceSink & operator=(const GNETAZSourceSink &)=delete
Invalidated assignment operator.
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
~GNETAZSourceSink()
destructor
bool checkDrawRelatedContour() const
check if draw related contour (cyan)
GNETAZSourceSink(const GNETAZSourceSink &)=delete
Invalidated copy constructor.
bool checkDrawFromContour() const
check if draw from contour (green)
const Parameterised::Map & getACParametersMap() const
get parameters map
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool checkDrawMoveContour() const
check if draw move contour (red)
GNEHierarchicalElement * getHierarchicalElement()
get GNEHierarchicalElement associated with this AttributeCarrier
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
bool checkDrawDeleteContourSmall() const
check if draw delete contour small (pink/white)
bool checkDrawDeleteContour() const
check if draw delete contour (pink/white)
GUIGlObject * getGUIGlObject()
bool checkDrawSelectContour() const
check if draw select contour (blue)
bool checkDrawOverContour() const
check if draw over contour (orange)
double getAttributeDouble(SumoXMLAttr key) const
bool isAttributeEnabled(SumoXMLAttr key) const
void writeTAZSourceSink(OutputDevice &device) const
write TAZ sourceSink
bool checkDrawToContour() const
check if draw from contour (magenta)
Position getAttributePosition(SumoXMLAttr key) const
double myWeight
depart Weight
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37