Eclipse SUMO - Simulation of Urban MObility
GNEEdgeRelData.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// class for edge relation data
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23
24// ===========================================================================
25// included modules
26// ===========================================================================
27
28#include "GNEGenericData.h"
29
30// ===========================================================================
31// class definitions
32// ===========================================================================
33
39
40public:
47 GNEEdgeRelData(GNEDataInterval* dataIntervalParent, GNEEdge* fromEdge, GNEEdge* toEdge,
48 const Parameterised::Map& parameters);
49
52
54 void setColor(const GUIVisualizationSettings& s) const;
55
56 double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const;
57
59 bool isGenericDataVisible() const;
60
62 void updateGeometry();
63
66
69
72 void writeGenericData(OutputDevice& device) const;
73
75 bool isGenericDataValid() const;
76
78 std::string getGenericDataProblem() const;
79
83
86
91 void drawGL(const GUIVisualizationSettings& s) const;
92
94 double getExaggeration(const GUIVisualizationSettings& s) const;
95
98
100
103
105 void computePathElement();
106
113 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const;
114
122 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const;
123
125 GNELane* getFirstPathLane() const;
126
128 GNELane* getLastPathLane() const;
130
133 /* @brief method for getting the Attribute of an XML key
134 * @param[in] key The attribute key
135 * @return string with the value associated to key
136 */
137 std::string getAttribute(SumoXMLAttr key) const;
138
139 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
140 * @param[in] key The attribute key
141 * @return double with the value associated to key
142 */
143 double getAttributeDouble(SumoXMLAttr key) const;
144
150 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
151
157 bool isValid(SumoXMLAttr key, const std::string& value);
158
159 /* @brief method for check if the value for certain attribute is set
160 * @param[in] key The attribute key
161 */
162 bool isAttributeEnabled(SumoXMLAttr key) const;
163
165 std::string getPopUpID() const;
166
168 std::string getHierarchyName() const;
170
171private:
173 void setAttribute(SumoXMLAttr key, const std::string& value);
174
177
180};
181
182/****************************************************************************/
183
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
An Element which don't belong to GNENet but has influence in the simulation.
Position getPositionInView() const
Returns element position in view.
bool isGenericDataValid() const
check if current data set is valid to be writed into XML (by default true, can be reimplemented in ch...
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
GNELane * getLastPathLane() const
get last path lane
GNEEdgeRelData(const GNEEdgeRelData &)=delete
Invalidated copy constructor.
double getAttributeDouble(SumoXMLAttr key) const
std::string getAttribute(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform data set changes
bool isAttributeEnabled(SumoXMLAttr key) const
void fixGenericDataProblem()
fix data set problem (by default throw an exception, has to be reimplemented in children)
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object (lane)
void computePathElement()
compute pathElement
std::string getGenericDataProblem() const
return a string with the current data set problem (by default empty, can be reimplemented in children...
bool isGenericDataVisible() const
check if current edge rel data is visible
Boundary getCenteringBoundary() const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void setColor(const GUIVisualizationSettings &s) const
get edge rel data color
~GNEEdgeRelData()
Destructor.
void writeGenericData(OutputDevice &device) const
write data set element into a xml file
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
GNEEdgeRelData(GNEDataInterval *dataIntervalParent, GNEEdge *fromEdge, GNEEdge *toEdge, const Parameterised::Map &parameters)
Constructor.
GNEEdgeRelData & operator=(const GNEEdgeRelData &)=delete
Invalidated assignment operator.
void updateGeometry()
update pre-computed geometry information
GNELane * getFirstPathLane() const
get first path lane
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
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
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