Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNETAZ.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
24
25#include "GNEAdditional.h"
26
27// ===========================================================================
28// class declaration
29// ===========================================================================
30
32
33// ===========================================================================
34// class definitions
35// ===========================================================================
36
37class GNETAZ : public GNEAdditional, public TesselatedPolygon {
38
39public:
42
44 GNETAZ(GNENet* net);
45
57 GNETAZ(const std::string& id, GNENet* net, const std::string& filename, const PositionVector& shape, const Position& TAZ,
58 const bool fill, const RGBColor& color, const std::string& name, const Parameterised::Map& parameters);
59
61 ~GNETAZ();
62
65
67 GNEMoveElement* getMoveElement() const override;
68
70 Parameterised* getParameters() override;
71
73 const Parameterised* getParameters() const override;
74
76
82 int getVertexIndex(Position pos, bool snapToGrid);
83
86
90 void writeAdditional(OutputDevice& device) const;
91
93 bool isAdditionalValid() const;
94
96 std::string getAdditionalProblem() const;
97
100
102
105
107 bool checkDrawMoveContour() const override;
108
110
113
115 void updateGeometry() override;
116
119
121 double getExaggeration(const GUIVisualizationSettings& s) const;
122
124 void updateCenteringBoundary(const bool updateGrid);
125
127 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
128
130
133
136 std::string getParentName() const;
137
146
151 void drawGL(const GUIVisualizationSettings& s) const;
152
154
157
158 /* @brief method for getting the Attribute of an XML key
159 * @param[in] key The attribute key
160 * @return string with the value associated to key
161 */
162 std::string getAttribute(SumoXMLAttr key) const override;
163
164 /* @brief method for getting the Attribute of an XML key in double format
165 * @param[in] key The attribute key
166 * @return double with the value associated to key
167 */
168 double getAttributeDouble(SumoXMLAttr key) const override;
169
170 /* @brief method for getting the Attribute of an XML key in position format
171 * @param[in] key The attribute key
172 * @return position with the value associated to key
173 */
174 Position getAttributePosition(SumoXMLAttr key) const override;
175
176 /* @brief method for getting the Attribute of an XML key in positionVector format
177 * @param[in] key The attribute key
178 * @return positionVector with the value associated to key
179 */
181
182 /* @brief method for setting the attribute and letting the object perform additional changes
183 * @param[in] key The attribute key
184 * @param[in] value The new value
185 * @param[in] undoList The undoList on which to register changes
186 */
187 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
188
189 /* @brief method for checking if the key and their corresponding attribute are valid
190 * @param[in] key The attribute key
191 * @param[in] value The value associated to key key
192 * @return true if the value is valid, false in other case
193 */
194 bool isValid(SumoXMLAttr key, const std::string& value) override;
195
197 std::string getPopUpID() const override;
198
200 std::string getHierarchyName() const override;
201
203
205 void updateTAZStatistic();
206
207protected:
210
213
215 bool myEdgesWithin = false;
216
217private:
219 static const double myHintSize;
220
222 static const double myHintSizeSquared;
223
226
229
232
234 double myMaxWeightSink = 0;
235
237 double myMinWeightSink = 0;
238
241
243 void setAttribute(SumoXMLAttr key, const std::string& value) override;
244
246 GNETAZ(const GNETAZ&) = delete;
247
249 GNETAZ& operator=(const GNETAZ&) = delete;
250};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const std::string getID() const
get ID (all Attribute Carriers have one)
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
Position getPositionInView() const
Returns position of additional in view.
Definition GNETAZ.cpp:190
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
Definition GNETAZ.cpp:482
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
Definition GNETAZ.cpp:202
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
Definition GNETAZ.cpp:146
double myMaxWeightSink
Max Sink weight.
Definition GNETAZ.h:234
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this TAZ
Definition GNETAZ.cpp:71
bool checkDrawMoveContour() const override
check if draw move contour (red)
Definition GNETAZ.cpp:158
static const double myHintSize
hint size of vertex
Definition GNETAZ.h:219
Position getAttributePosition(SumoXMLAttr key) const override
Definition GNETAZ.cpp:469
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition GNETAZ.cpp:262
GNEContour myTAZCenterContour
TAZ center contour.
Definition GNETAZ.h:212
bool myEdgesWithin
use edges whithin during creation (only in edit mode)
Definition GNETAZ.h:215
Parameterised * getParameters() override
get parameters associated with this TAZ
Definition GNETAZ.cpp:77
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
Definition GNETAZ.cpp:140
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
Definition GNETAZ.cpp:196
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
Definition GNETAZ.cpp:553
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Definition GNETAZ.cpp:230
~GNETAZ()
GNETAZ Destructor.
Definition GNETAZ.cpp:65
double myAverageWeightSource
Average source weight.
Definition GNETAZ.h:231
double getAttributeDouble(SumoXMLAttr key) const override
Definition GNETAZ.cpp:448
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
Definition GNETAZ.cpp:559
double myMinWeightSink
Min Sink weight.
Definition GNETAZ.h:237
double myAverageWeightSink
Average Sink weight.
Definition GNETAZ.h:240
std::string getParentName() const
Returns the name of the parent object.
Definition GNETAZ.cpp:236
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNETAZ.cpp:493
GNEMoveElementShape * myMoveElementShape
move element shape
Definition GNETAZ.h:209
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
Definition GNETAZ.cpp:152
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
Definition GNETAZ.cpp:105
bool isValid(SumoXMLAttr key, const std::string &value) override
Definition GNETAZ.cpp:516
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition GNETAZ.cpp:242
static const double myHintSizeSquared
squaredhint size of vertex
Definition GNETAZ.h:222
void updateTAZStatistic()
update TAZ Statistic
Definition GNETAZ.cpp:565
double myMinWeightSource
Min source weight.
Definition GNETAZ.h:228
int getVertexIndex(Position pos, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
Definition GNETAZ.cpp:89
void updateGeometry() override
update pre-computed geometry information
Definition GNETAZ.cpp:174
double myMaxWeightSource
Max source weight.
Definition GNETAZ.h:225
GNETAZ & operator=(const GNETAZ &)=delete
Invalidated assignment operator.
GNETAZ(const GNETAZ &)=delete
Invalidated copy constructor.
std::string getAttribute(SumoXMLAttr key) const override
Definition GNETAZ.cpp:378
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.
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
A list of positions.