Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEStoppingPlace.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// A abstract class to define common parameters of lane area in which vehicles can halt (GNE version)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEAdditional.h"
24
25// ===========================================================================
26// class declaration
27// ===========================================================================
28
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
34
36
37public:
43
58 GNEStoppingPlace(const std::string& id, GNENet* net, const std::string& filename, SumoXMLTag tag, GNELane* lane,
59 const double startPos, const double endPos, const std::string& name, bool friendlyPosition,
60 const RGBColor& color, const double angle, const Parameterised::Map& parameters);
61
64
67
69 GNEMoveElement* getMoveElement() const override;
70
72 Parameterised* getParameters() override;
73
75 const Parameterised* getParameters() const override;
76
78
81
83 bool isAdditionalValid() const;
84
86 std::string getAdditionalProblem() const;
87
90
92
95
97 bool checkDrawMoveContour() const override;
98
100
103
106
108 void updateCenteringBoundary(const bool updateGrid);
109
111 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
112
114
119 std::string getParentName() const;
120
122
125
126 /* @brief method for getting the Attribute of an XML key in position format
127 * @param[in] key The attribute key
128 * @return position with the value associated to key
129 */
130 Position getAttributePosition(SumoXMLAttr key) const override;
131
132 /* @brief method for getting the Attribute of an XML key in positionVector format
133 * @param[in] key The attribute key
134 * @return positionVector with the value associated to key
135 */
137
138 /* @brief method for check if the value for certain attribute is set
139 * @param[in] key The attribute key
140 */
141 bool isAttributeEnabled(SumoXMLAttr key) const;
142
144 std::string getPopUpID() const override;
145
147 std::string getHierarchyName() const override;
148
150
151protected:
154
157
159 bool myFriendlyPosition = false;
160
163
165 double myAngle = 0;
166
169
172
175
178
180 void writeStoppingPlaceAttributes(OutputDevice& device) const;
181
182 /* @brief method for getting the stoppingPlace attribute of an XML key
183 * @param[in] key The attribute key
184 * @return string with the value associated to key
185 */
186 std::string getStoppingPlaceAttribute(SumoXMLAttr key) const;
187
188 /* @brief method for getting the Attribute of an XML key in double format
189 * @param[in] key The attribute key
190 * @return double with the value associated to key
191 */
193
194 /* @brief method for getting the Attribute of an XML key in position format
195 * @param[in] key The attribute key
196 * @return position with the value associated to key
197 */
199
200 /* @brief method for setting the stoppingPlace attribute and letting the object perform additional changes
201 * @param[in] key The attribute key
202 * @param[in] value The new value
203 * @param[in] undoList The undoList on which to register changes
204 */
205 void setStoppingPlaceAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
206
207 /* @brief method for check if new value for certain stoppingPlace attribute is valid
208 * @param[in] key The attribute key
209 * @param[in] value The new value
210 */
211 bool isStoppingPlaceValid(SumoXMLAttr key, const std::string& value) const;
212
214 void setStoppingPlaceAttribute(SumoXMLAttr key, const std::string& value);
215
217
219 void setStoppingPlaceGeometry(double movingToSide);
220
222 void drawLines(const GUIVisualizationSettings::Detail d, const std::vector<std::string>& lines,
223 const RGBColor& color) const;
224
226 void drawSign(const GUIVisualizationSettings& s, const GUIVisualizationSettings::Detail d, const double exaggeration,
227 const RGBColor& baseColor, const RGBColor& signColor, const std::string& word) const;
228
231 const double width, const double exaggeration, const bool movingGeometryPoints) const;
232
233private:
235 void setPosition(const Position& pos) = delete;
236
239
242};
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
GNEStoppingPlace(const GNEStoppingPlace &)=delete
Invalidated copy constructor.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
bool isStoppingPlaceValid(SumoXMLAttr key, const std::string &value) const
void setStoppingPlaceAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
double myEndPosPosOverLane
The end position over lane.
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this stoppingPlace
void writeStoppingPlaceAttributes(OutputDevice &device) const
write common stoppingPlace attributes
Position getPositionInView() const
Returns position of additional in view.
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
Position getAttributePosition(SumoXMLAttr key) const override
void drawSign(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const RGBColor &baseColor, const RGBColor &signColor, const std::string &word) const
draw sign
~GNEStoppingPlace()
Destructor.
GNEMoveElementLaneDouble * myMoveElementLaneDouble
move element lane double
Parameterised * getParameters() override
get parameters associated with this stoppingPlace
double getStoppingPlaceAttributeDouble(SumoXMLAttr key) const
RGBColor myColor
RGB color.
void calculateStoppingPlaceContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const double exaggeration, const bool movingGeometryPoints) const
check object in view
bool myFriendlyPosition
Flag for friendly position.
void drawLines(const GUIVisualizationSettings::Detail d, const std::vector< std::string > &lines, const RGBColor &color) const
draw lines
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Position mySymbolPosition
The position of the sign.
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
double myStartPosOverLane
The start position over lane.
GNEStoppingPlace & operator=(const GNEStoppingPlace &src)=delete
Invalidated assignment operator.
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
bool isAttributeEnabled(SumoXMLAttr key) const
GNEContour mySymbolContour
circle contour
Position getStoppingPlaceAttributePosition(SumoXMLAttr key) const
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
void setPosition(const Position &pos)=delete
Invalidate set new position in the view.
std::string getParentName() const
Returns the name of the parent object (if any)
bool checkDrawMoveContour() const override
check if draw move contour (red)
std::string getStoppingPlaceAttribute(SumoXMLAttr key) const
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
A list of positions.
static const RGBColor INVISIBLE
Definition RGBColor.h:198