Eclipse SUMO - Simulation of Urban MObility
GNETAZSourceSink.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>
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
57 void writeAdditional(OutputDevice& device) const;
58
60 double getDepartWeight() const;
61
65 void updateGeometry();
66
69
71 double getExaggeration(const GUIVisualizationSettings& s) const;
72
75
77 void updateCenteringBoundary(const bool updateGrid);
78
80 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
82
85
88 std::string getParentName() const;
89
98
103 void drawGL(const GUIVisualizationSettings& s) const;
105
108 /* @brief method for getting the Attribute of an XML key
109 * @param[in] key The attribute key
110 * @return string with the value associated to key
111 */
112 std::string getAttribute(SumoXMLAttr key) const;
113
114 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
115 * @param[in] key The attribute key
116 * @return double with the value associated to key
117 */
118 double getAttributeDouble(SumoXMLAttr key) const;
119
122
123 /* @brief method for getting the Attribute of an XML key in position format (to avoid unnecessary parse<position>(...) for certain attributes)
124 * @param[in] key The attribute key
125 * @return double with the value associated to key
126 */
128
129 /* @brief method for setting the attribute and letting the object perform additional changes
130 * @param[in] key The attribute key
131 * @param[in] value The new value
132 * @param[in] undoList The undoList on which to register changes
133 * @param[in] net optionally the GNENet to inform about gui updates
134 */
135 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
136
137 /* @brief method for setting the attribute and letting the object perform additional changes
138 * @param[in] key The attribute key
139 * @param[in] value The new value
140 * @param[in] undoList The undoList on which to register changes
141 */
142 bool isValid(SumoXMLAttr key, const std::string& value);
143
144 /* @brief method for check if the value for certain attribute is set
145 * @param[in] key The attribute key
146 */
147 bool isAttributeEnabled(SumoXMLAttr key) const;
148
150 std::string getPopUpID() const;
151
153 std::string getHierarchyName() const;
155
156protected:
159
160private:
162 void setAttribute(SumoXMLAttr key, const std::string& value);
163
165 void setMoveShape(const GNEMoveResult& moveResult);
166
168 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
169
172
175};
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.
Definition: GNEAdditional.h:48
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
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
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
GNETAZSourceSink(SumoXMLTag tag, GNENet *net)
default Constructor
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string getParentName() const
Returns the name of the parent object.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
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.
Definition: OutputDevice.h:61
An upper class for objects with additional parameters.
Definition: Parameterised.h:41
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