Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
58
62 void writeDemandElement(OutputDevice& device) const;
63
66
68 std::string getDemandElementProblem() const;
69
72
77
79 const RGBColor& getColor() const;
80
82
86 void updateGeometry();
87
91
94
97 std::string getParentName() const;
98
100 double getExaggeration(const GUIVisualizationSettings& s) const;
101
106
108 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
109
114 void drawGL(const GUIVisualizationSettings& s) const;
115
117
120
122 void computePathElement();
123
129 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
130
136 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
137
139 GNELane* getFirstPathLane() const;
140
142 GNELane* getLastPathLane() const;
144
147 /* @brief method for getting the Attribute of an XML key
148 * @param[in] key The attribute key
149 * @return string with the value associated to key
150 */
151 std::string getAttribute(SumoXMLAttr key) const;
152
153 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
154 * @param[in] key The attribute key
155 * @return double with the value associated to key
156 */
157 double getAttributeDouble(SumoXMLAttr key) const;
158
159 /* @brief method for getting the Attribute of an XML key in Position format (used in person plans)
160 * @param[in] key The attribute key
161 * @return double with the value associated to key
162 */
164
165 /* @brief method for setting the attribute and letting the object perform demand element changes
166 * @param[in] key The attribute key
167 * @param[in] value The new value
168 * @param[in] undoList The undoList on which to register changes
169 * @param[in] net optionally the GNENet to inform about gui updates
170 */
171 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
172
173 /* @brief method for setting the attribute and letting the object perform demand element changes
174 * @param[in] key The attribute key
175 * @param[in] value The new value
176 * @param[in] undoList The undoList on which to register changes
177 */
178 bool isValid(SumoXMLAttr key, const std::string& value);
179
180 /* @brief method for enable attribute
181 * @param[in] key The attribute key
182 * @param[in] undoList The undoList on which to register changes
183 * @note certain attributes can be only enabled, and can produce the disabling of other attributes
184 */
185 void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList);
186
187 /* @brief method for disable attribute
188 * @param[in] key The attribute key
189 * @param[in] undoList The undoList on which to register changes
190 * @note certain attributes can be only enabled, and can produce the disabling of other attributes
191 */
192 void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList);
193
194 /* @brief method for check if the value for certain attribute is set
195 * @param[in] key The attribute key
196 */
197 bool isAttributeEnabled(SumoXMLAttr key) const;
198
200 std::string getPopUpID() const;
201
203 std::string getHierarchyName() const;
205
208
209protected:
212
215
218
221
224
226 std::string myActType;
227
229 bool myFriendlyPos = false;
230
233
234private:
236 void setAttribute(SumoXMLAttr key, const std::string& value);
237
239 void toggleAttribute(SumoXMLAttr key, const bool value);
240
242 void setMoveShape(const GNEMoveResult& moveResult);
243
245 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
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
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
GNEPlanParents (used for group all plan parents)
GNEContour myStopContour
variable used for draw contours
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
bool isAttributeEnabled(SumoXMLAttr key) const
std::string getParentName() const
Returns the name of the parent object.
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over lane.
SUMOTime myDuration
duration
GNEContour myStopSignContour
variable used for draw sign contours
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
bool myFriendlyPos
friendly pos
void toggleAttribute(SumoXMLAttr key, const bool value)
method for enable or disable the attribute and nothing else (used in GNEChange_ToggleAttribute)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
GNEStopPlan(const GNEStopPlan &)=delete
Invalidated copy constructor.
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
GNEMoveOperation * getMoveOperation()
get move operation
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEStopPlan & operator=(const GNEStopPlan &)=delete
Invalidated assignment operator.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
SUMOTime myUntil
until
Problem isDemandElementValid() const
check if current demand element is valid to be written into XML (by default true, can be reimplemente...
GNELane * getLastPathLane() const
get last path lane
void updateGeometry()
update pre-computed geometry information
void computePathElement()
compute pathElement
Position mySignPosition
sign position
double getAttributeDouble(SumoXMLAttr key) const
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
const Parameterised::Map & getACParametersMap() const
get parameters map
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
std::string myActType
act type
Position getPositionInView() const
Returns position of demand element in view.
GNELane * getFirstPathLane() const
get first path lane
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
~GNEStopPlan()
destructor
const RGBColor & getColor() const
get color
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void writeDemandElement(OutputDevice &device) const
write demand element element into a xml file
Position getAttributePosition(SumoXMLAttr key) const
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
int myParametersSet
parameter set
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over junction.
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