Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNERouteRef.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2016-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// A class for route references
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEDemandElement.h"
24
25// ===========================================================================
26// class declarations
27// ===========================================================================
28
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
34
36
37public:
39 GNERouteRef(GNENet* net);
40
42 GNERouteRef(GNEDemandElement* distributionParent, GNEDemandElement* routeParent);
43
45 GNERouteRef(GNEDemandElement* distributionParent, GNEDemandElement* routeParent, const double probability);
46
49
52
54 GNEMoveElement* getMoveElement() const override;
55
57 Parameterised* getParameters() override;
58
60 const Parameterised* getParameters() const override;
61
63
67 void writeDemandElement(OutputDevice& device) const override;
68
70 Problem isDemandElementValid() const override;
71
73 std::string getDemandElementProblem() const override;
74
76 void fixDemandElementProblem() override;
77
81 SUMOVehicleClass getVClass() const override;
82
84 const RGBColor& getColor() const override;
85
87
91 void updateGeometry() override;
92
94 Position getPositionInView() const override;
96
99
108
112 std::string getParentName() const override;
113
115 double getExaggeration(const GUIVisualizationSettings& s) const override;
116
120 Boundary getCenteringBoundary() const override;
121
123 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;
124
129 void drawGL(const GUIVisualizationSettings& s) const override;
130
132
135
137 void computePathElement() override;
138
144 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
145
151 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
152
154 GNELane* getFirstPathLane() const override;
155
157 GNELane* getLastPathLane() const override;
159
162 /* @brief method for getting the Attribute of an XML key
163 * @param[in] key The attribute key
164 * @return string with the value associated to key
165 */
166 std::string getAttribute(SumoXMLAttr key) const override;
167
168 /* @brief method for getting the Attribute of an XML key in double format
169 * @param[in] key The attribute key
170 * @return double with the value associated to key
171 */
172 double getAttributeDouble(SumoXMLAttr key) const override;
173
174 /* @brief method for getting the Attribute of an XML key in position format
175 * @param[in] key The attribute key
176 * @return position with the value associated to key
177 */
178 Position getAttributePosition(SumoXMLAttr key) const override;
179
180 /* @brief method for check if the value for certain attribute is set
181 * @param[in] key The attribute key
182 */
183 bool isAttributeEnabled(SumoXMLAttr key) const override;
184
185 /* @brief method for setting the attribute and letting the object perform additional changes
186 * @param[in] key The attribute key
187 * @param[in] value The new value
188 * @param[in] undoList The undoList on which to register changes
189 * @param[in] net optionally the GNENet to inform about gui updates
190 */
191 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
192
193 /* @brief method for setting the attribute and letting the object perform additional changes
194 * @param[in] key The attribute key
195 * @param[in] value The new value
196 * @param[in] undoList The undoList on which to register changes
197 */
198 bool isValid(SumoXMLAttr key, const std::string& value) override;
199
200 /* @brief method for check if the value for certain attribute is computed (for example, due a network recomputing)
201 * @param[in] key The attribute key
202 */
203 bool isAttributeComputed(SumoXMLAttr key) const override;
204
206 std::string getPopUpID() const override;
207
209 std::string getHierarchyName() const override;
210
212
213protected:
216
217private:
219 void setAttribute(SumoXMLAttr key, const std::string& value) override;
220
223
226};
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:68
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
bool isValid(SumoXMLAttr key, const std::string &value) override
SUMOVehicleClass getVClass() const override
obtain VClass related with this demand element
std::string getParentName() const override
Returns the name of the parent object.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
Position getPositionInView() const override
Returns position of additional in view.
void computePathElement() override
compute pathElement
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over lane.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
GNERouteRef & operator=(GNERouteRef *)=delete
Invalidated assignment operator.
~GNERouteRef()
destructor
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this routeRef
double getAttributeDouble(SumoXMLAttr key) const override
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
void updateGeometry() override
update pre-computed geometry information
Problem isDemandElementValid() const override
check if current demand element is valid to be written into XML (by default true, can be reimplemente...
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
bool isAttributeEnabled(SumoXMLAttr key) const override
double myProbability
probability
std::string getDemandElementProblem() const override
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
bool isAttributeComputed(SumoXMLAttr key) const override
Parameterised * getParameters() override
get parameters associated with this routeRef
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
Position getAttributePosition(SumoXMLAttr key) const override
GNELane * getLastPathLane() const override
get last path lane
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over junction.
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
void writeDemandElement(OutputDevice &device) const override
write demand element element into a xml file
const RGBColor & getColor() const override
get color
void fixDemandElementProblem() override
fix demand element problem (by default throw an exception, has to be reimplemented in children)
GNELane * getFirstPathLane() const override
get first path lane
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
GNERouteRef(GNERouteRef *)=delete
Invalidated copy constructor.
The popup menu of a globject.
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