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-2023 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 void updateGeometry();
98
101
103 double getExaggeration(const GUIVisualizationSettings& s) const;
104
106 void updateCenteringBoundary(const bool updateGrid);
107
109 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
110
112
115
118 std::string getParentName() const;
119
128
133 void drawGL(const GUIVisualizationSettings& s) const;
134
136
139
140 /* @brief method for getting the Attribute of an XML key
141 * @param[in] key The attribute key
142 * @return string with the value associated to key
143 */
144 std::string getAttribute(SumoXMLAttr key) const;
145
146 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
147 * @param[in] key The attribute key
148 * @return double with the value associated to key
149 */
150 double getAttributeDouble(SumoXMLAttr key) const;
151
152 /* @brief method for getting the Attribute of an XML key in position format (to avoid unnecessary parse<position>(...) for certain attributes)
153 * @param[in] key The attribute key
154 * @return double with the value associated to key
155 */
157
160
161 /* @brief method for setting the attribute and letting the object perform additional changes
162 * @param[in] key The attribute key
163 * @param[in] value The new value
164 * @param[in] undoList The undoList on which to register changes
165 */
166 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
167
168 /* @brief method for checking if the key and their conrrespond attribute are valids
169 * @param[in] key The attribute key
170 * @param[in] value The value associated to key key
171 * @return true if the value is valid, false in other case
172 */
173 bool isValid(SumoXMLAttr key, const std::string& value);
174
176 std::string getPopUpID() const;
177
179 std::string getHierarchyName() const;
180
182
184 void updateTAZStadistic();
185
186protected:
189
190private:
192 static const double myHintSize;
193
195 static const double myHintSizeSquared;
196
199
202
205
208
211
214
216 void drawDottedContours(const GUIVisualizationSettings& s, const double TAZExaggeration) const;
217
219 void setAttribute(SumoXMLAttr key, const std::string& value);
220
222 void setMoveShape(const GNEMoveResult& moveResult);
223
225 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
226
228 GNETAZ(const GNETAZ&) = delete;
229
231 GNETAZ& operator=(const GNETAZ&) = delete;
232};
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:218
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
Definition GNETAZ.cpp:230
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
Definition GNETAZ.cpp:194
double myMaxWeightSink
Max Sink weight.
Definition GNETAZ.h:207
Position myTAZCenter
TAZ center.
Definition GNETAZ.h:188
static const double myHintSize
hint size of vertex
Definition GNETAZ.h:192
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition GNETAZ.cpp:291
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition GNETAZ.cpp:594
bool isAdditionalValid() const
check if current additional is valid to be writed into XML (must be reimplemented in all detector chi...
Definition GNETAZ.cpp:188
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
Definition GNETAZ.cpp:224
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Definition GNETAZ.cpp:258
Position getAttributePosition(SumoXMLAttr key) const
Definition GNETAZ.cpp:513
void drawDottedContours(const GUIVisualizationSettings &s, const double TAZExaggeration) const
draw dotted contours
Definition GNETAZ.cpp:663
~GNETAZ()
GNETAZ Destructor.
Definition GNETAZ.cpp:83
double myAverageWeightSource
Average source weight.
Definition GNETAZ.h:204
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Definition GNETAZ.cpp:791
void updateTAZStadistic()
update TAZ Stadistic
Definition GNETAZ.cpp:606
void updateGeometry()
update pre-computed geometry information
Definition GNETAZ.cpp:206
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
Definition GNETAZ.cpp:553
double myMinWeightSink
Min Sink weight.
Definition GNETAZ.h:210
GNEMoveOperation * getMoveOperation()
get move operation
Definition GNETAZ.cpp:87
double myAverageWeightSink
Average Sink weight.
Definition GNETAZ.h:213
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition GNETAZ.cpp:600
std::string getParentName() const
Returns the name of the parent object.
Definition GNETAZ.cpp:264
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
Definition GNETAZ.cpp:200
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
Definition GNETAZ.cpp:155
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition GNETAZ.cpp:121
std::string getAttribute(SumoXMLAttr key) const
Definition GNETAZ.cpp:420
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition GNETAZ.cpp:270
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:530
static const double myHintSizeSquared
squaredhint size of vertex
Definition GNETAZ.h:195
double myMinWeightSource
Min source weight.
Definition GNETAZ.h:201
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:105
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Definition GNETAZ.cpp:821
const Parameterised::Map & getACParametersMap() const
get parameters map
Definition GNETAZ.cpp:524
double getAttributeDouble(SumoXMLAttr key) const
Definition GNETAZ.cpp:492
double myMaxWeightSource
Max source weight.
Definition GNETAZ.h:198
GNETAZ & operator=(const GNETAZ &)=delete
Invalidated assignment operator.
GNETAZ(const GNETAZ &)=delete
Invalidated copy constructor.
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.