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
53 GNEMoveElement* getMoveElement() const override;
54
56 Parameterised* getParameters() override;
57
59 const Parameterised* getParameters() const override;
60
62
65
67 void writeTAZSourceSink(OutputDevice& device) const;
68
70 double getWeight() const;
71
75 GUIGlObject* getGUIGlObject() override;
76
78 const GUIGlObject* getGUIGlObject() const override;
79
81 void updateGeometry() override;
82
84
87
89 bool checkDrawFromContour() const override;
90
92 bool checkDrawToContour() const override;
93
95 bool checkDrawRelatedContour() const override;
96
98 bool checkDrawOverContour() const override;
99
101 bool checkDrawDeleteContour() const override;
102
104 bool checkDrawDeleteContourSmall() const override;
105
107 bool checkDrawSelectContour() const override;
108
110 bool checkDrawMoveContour() const override;
111
113
116
117 /* @brief method for getting the Attribute of an XML key
118 * @param[in] key The attribute key
119 * @return string with the value associated to key
120 */
121 std::string getAttribute(SumoXMLAttr key) const override;
122
123 /* @brief method for getting the Attribute of an XML key in double format
124 * @param[in] key The attribute key
125 * @return double with the value associated to key
126 */
127 double getAttributeDouble(SumoXMLAttr key) const override;
128
129 /* @brief method for getting the Attribute of an XML key in position format
130 * @param[in] key The attribute key
131 * @return position with the value associated to key
132 */
133 Position getAttributePosition(SumoXMLAttr key) const override;
134
135 /* @brief method for getting the Attribute of an XML key in positionVector format
136 * @param[in] key The attribute key
137 * @return positionVector with the value associated to key
138 */
140
141 /* @brief method for setting the attribute and letting the object perform additional changes
142 * @param[in] key The attribute key
143 * @param[in] value The new value
144 * @param[in] undoList The undoList on which to register changes
145 * @param[in] net optionally the GNENet to inform about gui updates
146 */
147 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
148
149 /* @brief method for setting the attribute and letting the object perform additional changes
150 * @param[in] key The attribute key
151 * @param[in] value The new value
152 * @param[in] undoList The undoList on which to register changes
153 */
154 bool isValid(SumoXMLAttr key, const std::string& value) override;
155
156 /* @brief method for check if the value for certain attribute is set
157 * @param[in] key The attribute key
158 */
159 bool isAttributeEnabled(SumoXMLAttr key) const override;
160
162 std::string getPopUpID() const override;
163
165 std::string getHierarchyName() const override;
166
168
169protected:
171 double myWeight = 0;
172
173private:
175 void setAttribute(SumoXMLAttr key, const std::string& value) override;
176
178 void setMoveShape(const GNEMoveResult& moveResult);
179
181 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
182
185
188};
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
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
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
methods to retrieve the elements linked to 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)
GNEHierarchicalElement * getHierarchicalElement()
get GNEHierarchicalElement associated with this AttributeCarrier
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
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.