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-2024 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
24// ===========================================================================
25// included modules
26// ===========================================================================
27#include "GNEGenericData.h"
28
29
30// ===========================================================================
31// class definitions
32// ===========================================================================
38
39public:
45 GNEEdgeData(GNEDataInterval* dataIntervalParent, GNEEdge* edgeParent, const Parameterised::Map& parameters);
46
49
52
53 double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const;
54
56 bool isGenericDataVisible() const;
57
59 void updateGeometry();
60
63
66
69 void writeGenericData(OutputDevice& device) const;
70
72 bool isGenericDataValid() const;
73
75 std::string getGenericDataProblem() const;
76
80
83
88 void drawGL(const GUIVisualizationSettings& s) const;
89
92
94
97
99 void computePathElement();
100
106 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
107
113 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
114
116 GNELane* getFirstPathLane() const;
117
119 GNELane* getLastPathLane() const;
121
124 /* @brief method for getting the Attribute of an XML key
125 * @param[in] key The attribute key
126 * @return string with the value associated to key
127 */
128 std::string getAttribute(SumoXMLAttr key) const;
129
130 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
131 * @param[in] key The attribute key
132 * @return double with the value associated to key
133 */
134 double getAttributeDouble(SumoXMLAttr key) const;
135
141 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
142
148 bool isValid(SumoXMLAttr key, const std::string& value);
149
150 /* @brief method for check if the value for certain attribute is set
151 * @param[in] key The attribute key
152 */
153 bool isAttributeEnabled(SumoXMLAttr key) const;
154
156 std::string getPopUpID() const;
157
159 std::string getHierarchyName() const;
161
162private:
164 void setAttribute(SumoXMLAttr key, const std::string& value);
165
167 GNEEdgeData(const GNEEdgeData&) = delete;
168
171};
172
173/****************************************************************************/
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.
Definition GNEEdgeData.h:37
bool isGenericDataVisible() const
check if current edge data is visible
std::string getAttribute(SumoXMLAttr key) const
void writeGenericData(OutputDevice &device) const
write data set element into a xml file
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
GNEEdgeData(const GNEEdgeData &)=delete
Invalidated copy constructor.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform data set changes
GNELane * getFirstPathLane() const
get first path lane
GNELane * getLastPathLane() const
get last path lane
bool isAttributeEnabled(SumoXMLAttr key) const
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
double getAttributeDouble(SumoXMLAttr key) const
GNEEdgeData & operator=(const GNEEdgeData &)=delete
Invalidated assignment operator.
std::string getPopUpID() const
get PopPup ID (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.
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()
update pre-computed geometry information
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...
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 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.
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.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37