Eclipse SUMO - Simulation of Urban MObility
GNETAZ.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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
77 void writeAdditional(OutputDevice& device) const;
78
82 void updateGeometry();
83
86
88 double getExaggeration(const GUIVisualizationSettings& s) const;
89
91 void updateCenteringBoundary(const bool updateGrid);
92
94 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
95
97
102 std::string getParentName() const;
103
112
117 void drawGL(const GUIVisualizationSettings& s) const;
119
122 /* @brief method for getting the Attribute of an XML key
123 * @param[in] key The attribute key
124 * @return string with the value associated to key
125 */
126 std::string getAttribute(SumoXMLAttr key) const;
127
128 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
129 * @param[in] key The attribute key
130 * @return double with the value associated to key
131 */
132 double getAttributeDouble(SumoXMLAttr key) const;
133
134 /* @brief method for getting the Attribute of an XML key in position format (to avoid unnecessary parse<position>(...) for certain attributes)
135 * @param[in] key The attribute key
136 * @return double with the value associated to key
137 */
139
142
143 /* @brief method for setting the attribute and letting the object perform additional changes
144 * @param[in] key The attribute key
145 * @param[in] value The new value
146 * @param[in] undoList The undoList on which to register changes
147 */
148 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
149
150 /* @brief method for checking if the key and their conrrespond attribute are valids
151 * @param[in] key The attribute key
152 * @param[in] value The value associated to key key
153 * @return true if the value is valid, false in other case
154 */
155 bool isValid(SumoXMLAttr key, const std::string& value);
156
158 std::string getPopUpID() const;
159
161 std::string getHierarchyName() const;
163
165 void updateTAZStadistic();
166
167protected:
170
171private:
173 static const double myHintSize;
174
176 static const double myHintSizeSquared;
177
180
183
186
189
192
195
197 void drawDottedContours(const GUIVisualizationSettings& s, const double TAZExaggeration) const;
198
200 void setAttribute(SumoXMLAttr key, const std::string& value);
201
203 void setMoveShape(const GNEMoveResult& moveResult);
204
206 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
207
209 GNETAZ(const GNETAZ&) = delete;
210
212 GNETAZ& operator=(const GNETAZ&) = delete;
213};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:48
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
Definition: GNETAZ.h:34
Position getPositionInView() const
Returns position of additional in view.
Definition: GNETAZ.cpp:199
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
Definition: GNETAZ.cpp:211
double myMaxWeightSink
Max Sink weight.
Definition: GNETAZ.h:188
Position myTAZCenter
TAZ center.
Definition: GNETAZ.h:169
static const double myHintSize
hint size of vertex
Definition: GNETAZ.h:173
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNETAZ.cpp:270
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNETAZ.cpp:568
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
Definition: GNETAZ.cpp:205
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNETAZ.cpp:237
Position getAttributePosition(SumoXMLAttr key) const
Definition: GNETAZ.cpp:487
void drawDottedContours(const GUIVisualizationSettings &s, const double TAZExaggeration) const
draw dotted contours
Definition: GNETAZ.cpp:637
~GNETAZ()
GNETAZ Destructor.
Definition: GNETAZ.cpp:82
double myAverageWeightSource
Average source weight.
Definition: GNETAZ.h:185
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Definition: GNETAZ.cpp:757
void updateTAZStadistic()
update TAZ Stadistic
Definition: GNETAZ.cpp:580
void updateGeometry()
update pre-computed geometry information
Definition: GNETAZ.cpp:187
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
Definition: GNETAZ.cpp:527
double myMinWeightSink
Min Sink weight.
Definition: GNETAZ.h:191
GNEMoveOperation * getMoveOperation()
get move operation
Definition: GNETAZ.cpp:86
double myAverageWeightSink
Average Sink weight.
Definition: GNETAZ.h:194
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNETAZ.cpp:574
std::string getParentName() const
Returns the name of the parent object (if any)
Definition: GNETAZ.cpp:243
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
Definition: GNETAZ.cpp:154
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNETAZ.cpp:120
std::string getAttribute(SumoXMLAttr key) const
Definition: GNETAZ.cpp:394
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNETAZ.cpp:249
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:504
static const double myHintSizeSquared
squaredhint size of vertex
Definition: GNETAZ.h:176
double myMinWeightSource
Min source weight.
Definition: GNETAZ.h:182
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:104
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Definition: GNETAZ.cpp:787
const Parameterised::Map & getACParametersMap() const
get parameters map
Definition: GNETAZ.cpp:498
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNETAZ.cpp:466
double myMaxWeightSource
Max source weight.
Definition: GNETAZ.h:179
GNETAZ & operator=(const GNETAZ &)=delete
Invalidated assignment operator.
GNETAZ(const GNETAZ &)=delete
Invalidated copy constructor.
GNETAZ(GNENet *net)
@default GNETAZ Constructor
Definition: GNETAZ.cpp:50
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.
Definition: OutputDevice.h:61
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
A list of positions.