Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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
54
56 GNEMoveElement* getMoveElement() const override;
57
59 Parameterised* getParameters() override;
60
62 const Parameterised* getParameters() const override;
63
65
67 FileBucket* getFileBucket() const override;
68
70 void writeTAZSourceSink(OutputDevice& device) const;
71
73 double getWeight() const;
74
78 GUIGlObject* getGUIGlObject() override;
79
81 const GUIGlObject* getGUIGlObject() const override;
82
84 void updateGeometry() override;
85
87
90
92 bool checkDrawFromContour() const override;
93
95 bool checkDrawToContour() const override;
96
98 bool checkDrawRelatedContour() const override;
99
101 bool checkDrawOverContour() const override;
102
104 bool checkDrawDeleteContour() const override;
105
107 bool checkDrawDeleteContourSmall() const override;
108
110 bool checkDrawSelectContour() const override;
111
113 bool checkDrawMoveContour() const override;
114
116
119
120 /* @brief method for getting the Attribute of an XML key
121 * @param[in] key The attribute key
122 * @return string with the value associated to key
123 */
124 std::string getAttribute(SumoXMLAttr key) const override;
125
126 /* @brief method for getting the Attribute of an XML key in double format
127 * @param[in] key The attribute key
128 * @return double with the value associated to key
129 */
130 double getAttributeDouble(SumoXMLAttr key) const override;
131
132 /* @brief method for getting the Attribute of an XML key in position format
133 * @param[in] key The attribute key
134 * @return position with the value associated to key
135 */
136 Position getAttributePosition(SumoXMLAttr key) const override;
137
138 /* @brief method for getting the Attribute of an XML key in positionVector format
139 * @param[in] key The attribute key
140 * @return positionVector with the value associated to key
141 */
143
144 /* @brief method for setting the attribute and letting the object perform additional changes
145 * @param[in] key The attribute key
146 * @param[in] value The new value
147 * @param[in] undoList The undoList on which to register changes
148 * @param[in] net optionally the GNENet to inform about gui updates
149 */
150 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
151
152 /* @brief method for setting the attribute and letting the object perform additional changes
153 * @param[in] key The attribute key
154 * @param[in] value The new value
155 * @param[in] undoList The undoList on which to register changes
156 */
157 bool isValid(SumoXMLAttr key, const std::string& value) override;
158
159 /* @brief method for check if the value for certain attribute is set
160 * @param[in] key The attribute key
161 */
162 bool isAttributeEnabled(SumoXMLAttr key) const override;
163
165 std::string getPopUpID() const override;
166
168 std::string getHierarchyName() const override;
169
171
172protected:
174 double myWeight = 0;
175
176private:
178 void setAttribute(SumoXMLAttr key, const std::string& value) override;
179
181 void setMoveShape(const GNEMoveResult& moveResult);
182
184 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
185
188
191};
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
double getWeight() const
get weight
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
double getAttributeDouble(SumoXMLAttr key) const override
bool checkDrawDeleteContourSmall() const override
check if draw delete contour small (pink/white)
GNETAZSourceSink & operator=(const GNETAZSourceSink &)=delete
Invalidated assignment operator.
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
~GNETAZSourceSink()
destructor
GNETAZSourceSink(const GNETAZSourceSink &)=delete
Invalidated copy constructor.
GNEMoveElement * getMoveElement() const override
get GNEMoveElement associated with this TAZSourceSink
bool checkDrawFromContour() const override
check if draw from contour (green)
void updateGeometry() override
update pre-computed geometry information
bool checkDrawToContour() const override
check if draw from contour (magenta)
bool checkDrawSelectContour() const override
check if draw select contour (blue)
Parameterised * getParameters() override
get parameters associated with this TAZSourceSink
bool isAttributeEnabled(SumoXMLAttr key) const override
bool checkDrawDeleteContour() const override
check if draw delete contour (pink/white)
bool checkDrawMoveContour() const override
check if draw move contour (red)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
bool isValid(SumoXMLAttr key, const std::string &value) override
GUIGlObject * getGUIGlObject() override
get GUIGlObject associated with this AttributeCarrier
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
void writeTAZSourceSink(OutputDevice &device) const
write TAZ sourceSink
Position getAttributePosition(SumoXMLAttr key) const override
bool checkDrawOverContour() const override
check if draw over contour (orange)
double myWeight
depart Weight
GNEHierarchicalElement * getHierarchicalElement() override
methods to retrieve the elements linked to this TAZSourceSink
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.