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 override;
59
61 Problem isDemandElementValid() const override;
62
64 std::string getDemandElementProblem() const override;
65
67 void fixDemandElementProblem() override;
68
72 SUMOVehicleClass getVClass() const override;
73
75 const RGBColor& getColor() const override;
76
78
82 void updateGeometry() override;
83
85 Position getPositionInView() const override;
87
90
93 std::string getParentName() const override;
94
98 Boundary getCenteringBoundary() const override;
99
101 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;
102
107 void drawGL(const GUIVisualizationSettings& s) const override;
108
110
113
115 void computePathElement() override;
116
122 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
123
129 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
130
132 GNELane* getFirstPathLane() const override;
133
135 GNELane* getLastPathLane() const override;
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
void computePathElement() override
compute pathElement
Problem isDemandElementValid() const override
check if current demand element is valid to be written into XML
SUMOVehicleClass getVClass() const override
obtain VClass related with this demand element
bool isValid(SumoXMLAttr key, const std::string &value) override
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
Parameterised * getParameters() override
get parameters associated with this routeDistribution
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
GNELane * getFirstPathLane() const override
get first path lane
void fixDemandElementProblem() override
fix demand element problem
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
void writeDemandElement(OutputDevice &device) const override
write demand element element into a xml file
std::string getParentName() const override
Returns the name of the parent object.
double getAttributeDouble(SumoXMLAttr key) const override
Position getAttributePosition(SumoXMLAttr key) const override
const RGBColor & getColor() const override
get color
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over junction.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Position getPositionInView() const override
Returns position of additional in view.
GNERouteDistribution * operator=(GNERouteDistribution *)=delete
Invalidated assignment operator.
void updateGeometry() override
update pre-computed geometry information
GNELane * getLastPathLane() const override
get last path lane
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
std::string getDemandElementProblem() const override
return a string with the current demand element problem
GNERouteDistribution(GNERouteDistribution *)=delete
Invalidated copy constructor.
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over lane.
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