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-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>
22#include "GNEAdditional.h"
23
24
25// ===========================================================================
26// class definitions
27// ===========================================================================
33
34public:
37
44 GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNEAdditional* TAZParent, GNEEdge* edge, double departWeight);
45
48
53
56
60 void writeAdditional(OutputDevice& device) const;
61
63 bool isAdditionalValid() const;
64
66 std::string getAdditionalProblem() const;
67
70
72
75
77 bool checkDrawMoveContour() const;
78
80
82 double getDepartWeight() const;
83
86
88 void updateGeometry();
89
92
95
97 void updateCenteringBoundary(const bool updateGrid);
98
100 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
101
103
106
110 std::string getParentName() const;
111
120
125 void drawGL(const GUIVisualizationSettings& s) const;
126
128
131
132 /* @brief method for getting the Attribute of an XML key
133 * @param[in] key The attribute key
134 * @return string with the value associated to key
135 */
136 std::string getAttribute(SumoXMLAttr key) const;
137
138 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
139 * @param[in] key The attribute key
140 * @return double with the value associated to key
141 */
142 double getAttributeDouble(SumoXMLAttr key) const;
143
146
147 /* @brief method for getting the Attribute of an XML key in position format (to avoid unnecessary parse<position>(...) for certain attributes)
148 * @param[in] key The attribute key
149 * @return double with the value associated to key
150 */
152
153 /* @brief method for setting the attribute and letting the object perform additional changes
154 * @param[in] key The attribute key
155 * @param[in] value The new value
156 * @param[in] undoList The undoList on which to register changes
157 * @param[in] net optionally the GNENet to inform about gui updates
158 */
159 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
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 bool isValid(SumoXMLAttr key, const std::string& value);
167
168 /* @brief method for check if the value for certain attribute is set
169 * @param[in] key The attribute key
170 */
171 bool isAttributeEnabled(SumoXMLAttr key) const;
172
174 std::string getPopUpID() const;
175
177 std::string getHierarchyName() const;
178
180
181protected:
184
185private:
187 void setAttribute(SumoXMLAttr key, const std::string& value);
188
190 void setMoveShape(const GNEMoveResult& moveResult);
191
193 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
194
197
200};
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
An Element which don't belong to GNENet but has influence in the simulation.
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
void updateGeometry()
update pre-computed geometry information
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
GNETAZSourceSink & operator=(const GNETAZSourceSink &)=delete
Invalidated assignment operator.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
double getDepartWeight() const
get depart weight
~GNETAZSourceSink()
destructor
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
GNEMoveOperation * getMoveOperation()
get move operation
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
double myDepartWeight
depart Weight
GNETAZSourceSink(const GNETAZSourceSink &)=delete
Invalidated copy constructor.
const Parameterised::Map & getACParametersMap() const
get parameters map
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool checkDrawMoveContour() const
check if draw move contour (red)
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string getParentName() const
Returns the name of the parent object.
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
double getAttributeDouble(SumoXMLAttr key) const
bool isAttributeEnabled(SumoXMLAttr key) const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Position getPositionInView() const
Returns position of additional in view.
Position getAttributePosition(SumoXMLAttr key) const
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