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-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// class for TAZ relation data
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23
24// ===========================================================================
25// included modules
26// ===========================================================================
27#include "GNEGenericData.h"
28
29
30// ===========================================================================
31// class definitions
32// ===========================================================================
38
39public:
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;
63
65 bool isGenericDataVisible() const;
66
68 void updateGeometry();
69
72
75
78 void writeGenericData(OutputDevice& device) const;
79
81 bool isGenericDataValid() const;
82
84 std::string getGenericDataProblem() const;
85
89
92
97 void drawGL(const GUIVisualizationSettings& s) const;
98
101
103
106
108 void computePathElement();
109
116 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const;
117
125 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const;
126
128 GNELane* getFirstPathLane() const;
129
131 GNELane* getLastPathLane() const;
133
136 /* @brief method for getting the Attribute of an XML key
137 * @param[in] key The attribute key
138 * @return string with the value associated to key
139 */
140 std::string getAttribute(SumoXMLAttr key) const;
141
142 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
143 * @param[in] key The attribute key
144 * @return double with the value associated to key
145 */
146 double getAttributeDouble(SumoXMLAttr key) const;
147
153 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
154
160 bool isValid(SumoXMLAttr key, const std::string& value);
161
162 /* @brief method for check if the value for certain attribute is set
163 * @param[in] key The attribute key
164 */
165 bool isAttributeEnabled(SumoXMLAttr key) const;
166
168 std::string getPopUpID() const;
169
171 std::string getHierarchyName() const;
173
174protected:
177
180
182 mutable double myLastWidth;
183
184private:
186 bool drawTAZRel() const;
187
189 void setAttribute(SumoXMLAttr key, const std::string& value);
190
192 bool setFunctionalColor(int activeScheme, RGBColor& col) const;
193
195 GNETAZRelData(const GNETAZRelData&) = delete;
196
199};
200
201/****************************************************************************/
202
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.
An Element which don't belong to GNENet but has influence in the simulation.
An Element which don't belong to GNENet but has influence in the simulation.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
An Element which don't belong to GNENet but has influence in the simulation.
bool isGenericDataValid() const
check if current data set is valid to be writed into XML (by default true, can be reimplemented in ch...
RGBColor setColor(const GUIVisualizationSettings &s) const
get TAZ rel data color
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object (lane)
void writeGenericData(OutputDevice &device) const
write data set element into a xml file
Boundary getCenteringBoundary() const
GNETAZRelData(const GNETAZRelData &)=delete
Invalidated copy constructor.
GUIGeometry myTAZRelGeometry
Geometry for TAZRel data.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform data set changes
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
bool isGenericDataVisible() const
check if current TAZ rel data is visible
GNELane * getLastPathLane() const
get last path lane
std::string getGenericDataProblem() const
return a string with the current data set problem (by default empty, can be reimplemented in children...
std::string getAttribute(SumoXMLAttr key) const
GNETAZRelData & operator=(const GNETAZRelData &)=delete
Invalidated assignment operator.
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
void updateGeometry()
update pre-computed geometry information
Position getPositionInView() const
Returns element position in view.
GNELane * getFirstPathLane() const
get first path lane
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GUIGeometry myTAZRelGeometryCenter
Geometry for TAZRel data (center)
void fixGenericDataProblem()
fix data set problem (by default throw an exception, has to be reimplemented in children)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool drawTAZRel() const
check draw conditions
bool isAttributeEnabled(SumoXMLAttr key) const
double myLastWidth
TAZRel data width.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
double getAttributeDouble(SumoXMLAttr key) const
bool setFunctionalColor(int activeScheme, RGBColor &col) const
sets the color according to the current scheme index and some tazRel function
void computePathElement()
compute pathElement
~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