Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNERouteDistribution.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// Route distribution used in netedit
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEDemandElement.h"
24
25// ===========================================================================
26// class definitions
27// ===========================================================================
28
30
31public:
34
36 GNERouteDistribution(const std::string& ID, GNENet* net, const std::string& filename);
37
40
43
45 GNEMoveElement* getMoveElement() const override;
46
48 Parameterised* getParameters() override;
49
51 const Parameterised* getParameters() const override;
52
54
58 void writeDemandElement(OutputDevice& device) const;
59
62
64 std::string getDemandElementProblem() const;
65
68
73
75 const RGBColor& getColor() const;
76
78
82 void updateGeometry() override;
83
87
90
93 std::string getParentName() const;
94
99
101 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
102
107 void drawGL(const GUIVisualizationSettings& s) const;
108
110
113
115 void computePathElement();
116
122 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
123
129 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
130
132 GNELane* getFirstPathLane() const;
133
135 GNELane* getLastPathLane() const;
137
140 /* @brief method for getting the Attribute of an XML key
141 * @param[in] key The attribute key
142 * @return string with the value associated to key
143 */
144 std::string getAttribute(SumoXMLAttr key) const override;
145
146 /* @brief method for getting the Attribute of an XML key in double format
147 * @param[in] key The attribute key
148 * @return double with the value associated to key
149 */
150 double getAttributeDouble(SumoXMLAttr key) const override;
151
152 /* @brief method for getting the Attribute of an XML key in position format
153 * @param[in] key The attribute key
154 * @return position with the value associated to key
155 */
156 Position getAttributePosition(SumoXMLAttr key) const override;
157
158 /* @brief method for setting the attribute and letting the object perform additional changes
159 * @param[in] key The attribute key
160 * @param[in] value The new value
161 * @param[in] undoList The undoList on which to register changes
162 * @param[in] net optionally the GNENet to inform about gui updates
163 */
164 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
165
166 /* @brief method for setting the attribute and letting the object perform additional changes
167 * @param[in] key The attribute key
168 * @param[in] value The new value
169 * @param[in] undoList The undoList on which to register changes
170 */
171 bool isValid(SumoXMLAttr key, const std::string& value) override;
172
174 std::string getPopUpID() const override;
175
177 std::string getHierarchyName() const override;
179
180private:
182 void setAttribute(SumoXMLAttr key, const std::string& value) override;
183
186
189};
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
Problem
enum class for demandElement problems
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this routeDistribution
GNELane * getFirstPathLane() const
get first path lane
bool isValid(SumoXMLAttr key, const std::string &value) override
Parameterised * getParameters() override
get parameters associated with this routeDistribution
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::string getDemandElementProblem() const
return a string with the current demand element problem
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
std::string getParentName() const
Returns the name of the parent object.
Problem isDemandElementValid() const
check if current demand element is valid to be written into XML
const RGBColor & getColor() const
get color
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
double getAttributeDouble(SumoXMLAttr key) const override
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
Position getAttributePosition(SumoXMLAttr key) const override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
GNERouteDistribution * operator=(GNERouteDistribution *)=delete
Invalidated assignment operator.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void updateGeometry() override
update pre-computed geometry information
void computePathElement()
compute pathElement
void fixDemandElementProblem()
fix demand element problem
void writeDemandElement(OutputDevice &device) const
write demand element element into a xml file
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over junction.
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
Position getPositionInView() const
Returns position of additional in view.
GNELane * getLastPathLane() const
get last path lane
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over lane.
GNERouteDistribution(GNERouteDistribution *)=delete
Invalidated copy constructor.
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37