Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNETAZRelData.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-2025 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// class for TAZ relation data
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25#include "GNEGenericData.h"
26
27// ===========================================================================
28// class definitions
29// ===========================================================================
35
36public:
39
46 GNETAZRelData(GNEDataInterval* dataIntervalParent, GNEAdditional* fromTAZ, GNEAdditional* toTAZ,
47 const Parameterised::Map& parameters);
48
54 GNETAZRelData(GNEDataInterval* dataIntervalParent, GNEAdditional* TAZ,
55 const Parameterised::Map& parameters);
56
59
62 double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const override;
63 double getScaleValue(const GUIVisualizationSettings& s, int activeScheme) const;
64
66 bool isGenericDataVisible() const override;
67
69 void updateGeometry() override;
70
72 Position getPositionInView() const override;
73
76
79 void writeGenericData(OutputDevice& device) const override;
80
82 bool isGenericDataValid() const override;
83
85 std::string getGenericDataProblem() const override;
86
88 void fixGenericDataProblem() override;
90
93
98 void drawGL(const GUIVisualizationSettings& s) const override;
99
101 Boundary getCenteringBoundary() const override;
102
104
107
109 void computePathElement() override;
110
116 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
117
123 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
124
126 GNELane* getFirstPathLane() const override;
127
129 GNELane* getLastPathLane() const override;
131
134 /* @brief method for getting the Attribute of an XML key
135 * @param[in] key The attribute key
136 * @return string with the value associated to key
137 */
138 std::string getAttribute(SumoXMLAttr key) const override;
139
140 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
141 * @param[in] key The attribute key
142 * @return double with the value associated to key
143 */
144 double getAttributeDouble(SumoXMLAttr key) const override;
145
151 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
152
158 bool isValid(SumoXMLAttr key, const std::string& value) override;
159
160 /* @brief method for check if the value for certain attribute is set
161 * @param[in] key The attribute key
162 */
163 bool isAttributeEnabled(SumoXMLAttr key) const override;
164
166 std::string getPopUpID() const override;
167
169 std::string getHierarchyName() const override;
171
172protected:
175
178
181
183 mutable double myLastWidth;
184
185private:
187 bool drawTAZRel() const;
188
190 void setAttribute(SumoXMLAttr key, const std::string& value) override;
191
193 bool setFunctionalColor(int activeScheme, RGBColor& col) const;
194
196 GNETAZRelData(const GNETAZRelData&) = delete;
197
200};
201
202/****************************************************************************/
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
An Element which don't belong to GNENet but has influence in the simulation.
RGBColor setColor(const GUIVisualizationSettings &s) const
get TAZ rel data color
bool isValid(SumoXMLAttr key, const std::string &value) override
method for checking if the key and their conrrespond attribute are valids
Boundary getCenteringBoundary() const override
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool isGenericDataVisible() const override
check if current TAZ rel data is visible
GNEContour myTAZRelDataContour
variable used for draw contours
GNETAZRelData(const GNETAZRelData &)=delete
Invalidated copy constructor.
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
bool isGenericDataValid() const override
check if current data set is valid to be written into XML (by default true, can be reimplemented in c...
GUIGeometry myTAZRelGeometry
Geometry for TAZRel data.
void updateGeometry() override
update pre-computed geometry information
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over lane.
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
void computePathElement() override
compute pathElement
void fixGenericDataProblem() override
fix data set problem (by default throw an exception, has to be reimplemented in children)
std::string getAttribute(SumoXMLAttr key) const override
GNELane * getFirstPathLane() const override
get first path lane
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const override
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over junction.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
method for setting the attribute and letting the object perform data set changes
double getScaleValue(const GUIVisualizationSettings &s, int activeScheme) const
GNETAZRelData & operator=(const GNETAZRelData &)=delete
Invalidated assignment operator.
GNELane * getLastPathLane() const override
get last path lane
bool isAttributeEnabled(SumoXMLAttr key) const override
double getAttributeDouble(SumoXMLAttr key) const override
GUIGeometry myTAZRelGeometryCenter
Geometry for TAZRel data (center)
bool drawTAZRel() const
check draw conditions
Position getPositionInView() const override
Returns element position in view.
std::string getGenericDataProblem() const override
return a string with the current data set problem (by default empty, can be reimplemented in children...
double myLastWidth
TAZRel data width.
void writeGenericData(OutputDevice &device) const override
write data set element into a xml file
bool setFunctionalColor(int activeScheme, RGBColor &col) const
sets the color according to the current scheme index and some tazRel function
~GNETAZRelData()
Destructor.
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