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-2024 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>
24
25#include "GNEAdditional.h"
26
27// ===========================================================================
28// class definitions
29// ===========================================================================
34class GNETAZ : public GNEAdditional, public TesselatedPolygon {
35
36public:
39
41 GNETAZ(GNENet* net);
42
53 GNETAZ(const std::string& id, GNENet* net, const PositionVector& shape, const Position& TAZ, const bool fill,
54 const RGBColor& color, const std::string& name, const Parameterised::Map& parameters);
55
57 ~GNETAZ();
58
63
69 int getVertexIndex(Position pos, bool snapToGrid);
70
72 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
73
76
80 void writeAdditional(OutputDevice& device) const;
81
83 bool isAdditionalValid() const;
84
86 std::string getAdditionalProblem() const;
87
90
92
95
97 bool checkDrawMoveContour() const;
98
100
103
105 void updateGeometry();
106
109
111 double getExaggeration(const GUIVisualizationSettings& s) const;
112
114 void updateCenteringBoundary(const bool updateGrid);
115
117 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
118
120
123
126 std::string getParentName() const;
127
136
141 void drawGL(const GUIVisualizationSettings& s) const;
142
144
147
148 /* @brief method for getting the Attribute of an XML key
149 * @param[in] key The attribute key
150 * @return string with the value associated to key
151 */
152 std::string getAttribute(SumoXMLAttr key) const;
153
154 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
155 * @param[in] key The attribute key
156 * @return double with the value associated to key
157 */
158 double getAttributeDouble(SumoXMLAttr key) const;
159
160 /* @brief method for getting the Attribute of an XML key in position format (to avoid unnecessary parse<position>(...) for certain attributes)
161 * @param[in] key The attribute key
162 * @return double with the value associated to key
163 */
165
168
169 /* @brief method for setting the attribute and letting the object perform additional changes
170 * @param[in] key The attribute key
171 * @param[in] value The new value
172 * @param[in] undoList The undoList on which to register changes
173 */
174 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
175
176 /* @brief method for checking if the key and their corresponding attribute are valid
177 * @param[in] key The attribute key
178 * @param[in] value The value associated to key key
179 * @return true if the value is valid, false in other case
180 */
181 bool isValid(SumoXMLAttr key, const std::string& value);
182
184 std::string getPopUpID() const;
185
187 std::string getHierarchyName() const;
188
190
192 void updateTAZStatistic();
193
194protected:
197
200
201private:
203 static const double myHintSize;
204
206 static const double myHintSizeSquared;
207
210
213
216
219
222
225
227 void setAttribute(SumoXMLAttr key, const std::string& value);
228
230 void setMoveShape(const GNEMoveResult& moveResult);
231
233 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
234
236 GNETAZ(const GNETAZ&) = delete;
237
239 GNETAZ& operator=(const GNETAZ&) = delete;
240};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element which don't belong to GNENet but has influence in the simulation.
const std::string getID() const
get ID (all Attribute Carriers have one)
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
Position getPositionInView() const
Returns position of additional in view.
Definition GNETAZ.cpp:236
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
Definition GNETAZ.cpp:248
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
Definition GNETAZ.cpp:192
double myMaxWeightSink
Max Sink weight.
Definition GNETAZ.h:218
Position myTAZCenter
TAZ center.
Definition GNETAZ.h:196
static const double myHintSize
hint size of vertex
Definition GNETAZ.h:203
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition GNETAZ.cpp:309
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition GNETAZ.cpp:600
GNEContour myTAZCenterContour
TAZ center contour.
Definition GNETAZ.h:199
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
Definition GNETAZ.cpp:186
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
Definition GNETAZ.cpp:242
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Definition GNETAZ.cpp:276
Position getAttributePosition(SumoXMLAttr key) const
Definition GNETAZ.cpp:519
~GNETAZ()
GNETAZ Destructor.
Definition GNETAZ.cpp:81
double myAverageWeightSource
Average source weight.
Definition GNETAZ.h:215
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Definition GNETAZ.cpp:739
void updateGeometry()
update pre-computed geometry information
Definition GNETAZ.cpp:220
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
Definition GNETAZ.cpp:561
double myMinWeightSink
Min Sink weight.
Definition GNETAZ.h:221
GNEMoveOperation * getMoveOperation()
get move operation
Definition GNETAZ.cpp:85
double myAverageWeightSink
Average Sink weight.
Definition GNETAZ.h:224
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition GNETAZ.cpp:606
std::string getParentName() const
Returns the name of the parent object.
Definition GNETAZ.cpp:282
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
Definition GNETAZ.cpp:198
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
Definition GNETAZ.cpp:153
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition GNETAZ.cpp:119
std::string getAttribute(SumoXMLAttr key) const
Definition GNETAZ.cpp:426
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition GNETAZ.cpp:288
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition GNETAZ.cpp:538
static const double myHintSizeSquared
squaredhint size of vertex
Definition GNETAZ.h:206
void updateTAZStatistic()
update TAZ Statistic
Definition GNETAZ.cpp:612
double myMinWeightSource
Min source weight.
Definition GNETAZ.h:212
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:103
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Definition GNETAZ.cpp:769
const Parameterised::Map & getACParametersMap() const
get parameters map
Definition GNETAZ.cpp:532
double getAttributeDouble(SumoXMLAttr key) const
Definition GNETAZ.cpp:498
double myMaxWeightSource
Max source weight.
Definition GNETAZ.h:209
GNETAZ & operator=(const GNETAZ &)=delete
Invalidated assignment operator.
GNETAZ(const GNETAZ &)=delete
Invalidated copy constructor.
bool checkDrawMoveContour() const
check if draw move contour (red)
Definition GNETAZ.cpp:204
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.
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.