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
45
49 void writeDemandElement(OutputDevice& device) const;
50
53
55 std::string getDemandElementProblem() const;
56
59
64
66 const RGBColor& getColor() const;
67
69
73 void updateGeometry();
74
78
81
84 std::string getParentName() const;
85
90
92 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
93
98 void drawGL(const GUIVisualizationSettings& s) const;
99
101
104
106 void computePathElement();
107
113 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
114
120 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
121
123 GNELane* getFirstPathLane() const;
124
126 GNELane* getLastPathLane() const;
128
131 /* @brief method for getting the Attribute of an XML key
132 * @param[in] key The attribute key
133 * @return string with the value associated to key
134 */
135 std::string getAttribute(SumoXMLAttr key) const;
136
137 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
138 * @param[in] key The attribute key
139 * @return double with the value associated to key
140 */
141 double getAttributeDouble(SumoXMLAttr key) const;
142
143 /* @brief method for getting the Attribute of an XML key in Position format (used in person plans)
144 * @param[in] key The attribute key
145 * @return double with the value associated to key
146 */
148
149 /* @brief method for setting the attribute and letting the object perform additional changes
150 * @param[in] key The attribute key
151 * @param[in] value The new value
152 * @param[in] undoList The undoList on which to register changes
153 * @param[in] net optionally the GNENet to inform about gui updates
154 */
155 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
156
157 /* @brief method for setting the attribute and letting the object perform additional changes
158 * @param[in] key The attribute key
159 * @param[in] value The new value
160 * @param[in] undoList The undoList on which to register changes
161 */
162 bool isValid(SumoXMLAttr key, const std::string& value);
163
165 std::string getPopUpID() const;
166
168 std::string getHierarchyName() const;
170
173
174private:
176 void setAttribute(SumoXMLAttr key, const std::string& value);
177
179 void setMoveShape(const GNEMoveResult& moveResult);
180
182 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
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
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
GNEMoveOperation * getMoveOperation()
get move operation
void updateGeometry()
update pre-computed geometry information
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
GNELane * getFirstPathLane() const
get first path lane
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
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
double getAttributeDouble(SumoXMLAttr key) const
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
Position getAttributePosition(SumoXMLAttr key) const
GNERouteDistribution * operator=(GNERouteDistribution *)=delete
Invalidated assignment operator.
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void computePathElement()
compute pathElement
void fixDemandElementProblem()
fix demand element problem
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
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.
const Parameterised::Map & getACParametersMap() const
get parameters map
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.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37