Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEStopPlan.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// Representation of Stops in netedit
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEDemandElement.h"
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
29
31
32public:
34 GNEStopPlan(SumoXMLTag tag, GNENet* net);
35
47 GNEStopPlan(SumoXMLTag tag, GNEDemandElement* personParent, const GNEPlanParents& planParameters,
48 const double endPos, const SUMOTime duration, const SUMOTime until, const std::string& actType,
49 bool friendlyPos, const int parameterSet);
50
53
56
58 GNEMoveElement* getMoveElement() const override;
59
61 Parameterised* getParameters() override;
62
64 const Parameterised* getParameters() const override;
65
67
71 void writeDemandElement(OutputDevice& device) const override;
72
74 Problem isDemandElementValid() const override;
75
77 std::string getDemandElementProblem() const override;
78
80 void fixDemandElementProblem() override;
81
85 SUMOVehicleClass getVClass() const override;
86
88 const RGBColor& getColor() const override;
89
91
95 void updateGeometry() override;
96
98 Position getPositionInView() const override;
100
103
106 std::string getParentName() const override;
107
109 double getExaggeration(const GUIVisualizationSettings& s) const override;
110
114 Boundary getCenteringBoundary() const override;
115
117 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;
118
123 void drawGL(const GUIVisualizationSettings& s) const override;
124
126
129
131 void computePathElement() override;
132
138 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
139
145 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
146
148 GNELane* getFirstPathLane() const override;
149
151 GNELane* getLastPathLane() const override;
153
156 /* @brief method for getting the Attribute of an XML key
157 * @param[in] key The attribute key
158 * @return string with the value associated to key
159 */
160 std::string getAttribute(SumoXMLAttr key) const override;
161
162 /* @brief method for getting the Attribute of an XML key in double format
163 * @param[in] key The attribute key
164 * @return double with the value associated to key
165 */
166 double getAttributeDouble(SumoXMLAttr key) const override;
167
168 /* @brief method for getting the Attribute of an XML key in position format
169 * @param[in] key The attribute key
170 * @return position with the value associated to key
171 */
172 Position getAttributePosition(SumoXMLAttr key) const override;
173
174 /* @brief method for setting the attribute and letting the object perform demand element changes
175 * @param[in] key The attribute key
176 * @param[in] value The new value
177 * @param[in] undoList The undoList on which to register changes
178 * @param[in] net optionally the GNENet to inform about gui updates
179 */
180 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
181
182 /* @brief method for setting the attribute and letting the object perform demand element changes
183 * @param[in] key The attribute key
184 * @param[in] value The new value
185 * @param[in] undoList The undoList on which to register changes
186 */
187 bool isValid(SumoXMLAttr key, const std::string& value) override;
188
189 /* @brief method for enable attribute
190 * @param[in] key The attribute key
191 * @param[in] undoList The undoList on which to register changes
192 * @note certain attributes can be only enabled, and can produce the disabling of other attributes
193 */
194 void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) override;
195
196 /* @brief method for disable attribute
197 * @param[in] key The attribute key
198 * @param[in] undoList The undoList on which to register changes
199 * @note certain attributes can be only enabled, and can produce the disabling of other attributes
200 */
201 void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList) override;
202
203 /* @brief method for check if the value for certain attribute is set
204 * @param[in] key The attribute key
205 */
206 bool isAttributeEnabled(SumoXMLAttr key) const override;
207
209 std::string getPopUpID() const override;
210
212 std::string getHierarchyName() const override;
214
215protected:
218
221
224
227
230
232 std::string myActType;
233
235 bool myFriendlyPos = false;
236
239
240private:
242 void setAttribute(SumoXMLAttr key, const std::string& value) override;
243
245 void toggleAttribute(SumoXMLAttr key, const bool value) override;
246
248 GNEStopPlan(const GNEStopPlan&) = delete;
249
252};
long long int SUMOTime
Definition GUI.h:36
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLTag
Numbers representing SUMO-XML - element names.
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
GNEPlanParents (used for group all plan parents)
GNEContour myStopContour
variable used for draw contours
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
double getAttributeDouble(SumoXMLAttr key) const override
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over lane.
GNELane * getLastPathLane() const override
get last path lane
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
SUMOTime myDuration
duration
GNEContour myStopSignContour
variable used for draw sign contours
Position getPositionInView() const override
Returns position of demand element in view.
const RGBColor & getColor() const override
get color
bool myFriendlyPos
friendly pos
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
SUMOVehicleClass getVClass() const override
obtain VClass related with this demand element
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList) override
GNEStopPlan(const GNEStopPlan &)=delete
Invalidated copy constructor.
void fixDemandElementProblem() override
fix demand element problem (by default throw an exception, has to be reimplemented in children)
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this stopPlan
bool isAttributeEnabled(SumoXMLAttr key) const override
GNEStopPlan & operator=(const GNEStopPlan &)=delete
Invalidated assignment operator.
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over junction.
SUMOTime myUntil
until
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
Problem isDemandElementValid() const override
check if current demand element is valid to be written into XML (by default true, can be reimplemente...
GNELane * getFirstPathLane() const override
get first path lane
void writeDemandElement(OutputDevice &device) const override
write demand element element into a xml file
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList) override
Position mySignPosition
sign position
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
std::string getDemandElementProblem() const override
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
Position getAttributePosition(SumoXMLAttr key) const override
void updateGeometry() override
update pre-computed geometry information
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
void computePathElement() override
compute pathElement
std::string myActType
act type
bool isValid(SumoXMLAttr key, const std::string &value) override
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
~GNEStopPlan()
destructor
void toggleAttribute(SumoXMLAttr key, const bool value) override
method for enable or disable the attribute and nothing else (used in GNEChange_ToggleAttribute)
Parameterised * getParameters() override
get parameters associated with this stopPlan
std::string getParentName() const override
Returns the name of the parent object.
int myParametersSet
parameter set
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