Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEEdgeData.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 edge data
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEGenericData.h"
24
25// ===========================================================================
26// class definitions
27// ===========================================================================
33
34public:
36 GNEEdgeData(GNENet* net);
37
43 GNEEdgeData(GNEDataInterval* dataIntervalParent, GNEEdge* edge, const Parameterised::Map& parameters);
44
47
50
51 double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const;
52
54 bool isGenericDataVisible() const override;
55
57 void updateGeometry() override;
58
61
64
67 void writeGenericData(OutputDevice& device) const override;
68
70 bool isGenericDataValid() const;
71
73 std::string getGenericDataProblem() const;
74
78
81
86 void drawGL(const GUIVisualizationSettings& s) const;
87
90
92
95
97 void computePathElement();
98
104 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
105
111 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
112
114 GNELane* getFirstPathLane() const;
115
117 GNELane* getLastPathLane() const;
119
122 /* @brief method for getting the Attribute of an XML key
123 * @param[in] key The attribute key
124 * @return string with the value associated to key
125 */
126 std::string getAttribute(SumoXMLAttr key) const override;
127
128 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
129 * @param[in] key The attribute key
130 * @return double with the value associated to key
131 */
132 double getAttributeDouble(SumoXMLAttr key) const override;
133
139 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
140
146 bool isValid(SumoXMLAttr key, const std::string& value) override;
147
148 /* @brief method for check if the value for certain attribute is set
149 * @param[in] key The attribute key
150 */
151 bool isAttributeEnabled(SumoXMLAttr key) const;
152
154 std::string getPopUpID() const override;
155
157 std::string getHierarchyName() const override;
159
160private:
162 void setAttribute(SumoXMLAttr key, const std::string& value) override;
163
165 GNEEdgeData(const GNEEdgeData&) = delete;
166
169};
170
171/****************************************************************************/
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 GNEEdgeData.h:32
bool isGenericDataVisible() const override
check if current edge data is visible
GNEEdgeData(const GNEEdgeData &)=delete
Invalidated copy constructor.
GNELane * getFirstPathLane() const
get first path lane
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
GNELane * getLastPathLane() const
get last path lane
void writeGenericData(OutputDevice &device) const override
write data set element into a xml file
bool isAttributeEnabled(SumoXMLAttr key) const
GNEEdgeData & operator=(const GNEEdgeData &)=delete
Invalidated assignment operator.
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over lane.
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over junction.
double getAttributeDouble(SumoXMLAttr key) const override
Boundary getCenteringBoundary() const
~GNEEdgeData()
Destructor.
RGBColor setColor(const GUIVisualizationSettings &s) const
get edge data color
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...
void updateGeometry() override
update pre-computed geometry information
bool isValid(SumoXMLAttr key, const std::string &value) override
method for checking if the key and their conrrespond attribute are valids
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
method for setting the attribute and letting the object perform data set changes
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool isGenericDataValid() const
check if current data set is valid to be written into XML (by default true, can be reimplemented in c...
std::string getAttribute(SumoXMLAttr key) const override
void fixGenericDataProblem()
fix data set problem (by default throw an exception, has to be reimplemented in children)
Position getPositionInView() const
Returns element position in view.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
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