Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEAccess.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//
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEAdditional.h"
24
25// ===========================================================================
26// class declarations
27// ===========================================================================
28
29class GNEBusStop;
31
32// ===========================================================================
33// class definitions
34// ===========================================================================
35
36class GNEAccess : public GNEAdditional, public Parameterised {
37
38public:
40 GNEAccess(GNENet* net);
41
51 GNEAccess(GNEAdditional* busStop, GNELane* lane, const double pos, const std::string& specialPos,
52 const bool friendlyPos, const double length, const Parameterised::Map& parameters);
53
55 ~GNEAccess();
56
59
61 GNEMoveElement* getMoveElement() const override;
62
64 Parameterised* getParameters() override;
65
67 const Parameterised* getParameters() const override;
68
70
72 bool isAccessPositionFixed() const;
73
75 GNEEdge* getEdge() const;
76
79
83 void writeAdditional(OutputDevice& device) const;
84
86 bool isAdditionalValid() const;
87
89 std::string getAdditionalProblem() const;
90
93
95
98
100 bool checkDrawMoveContour() const override;
101
103
106
108 void updateGeometry() override;
109
112
114 void updateCenteringBoundary(const bool updateGrid);
115
117 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
118
120
123
125 std::string getParentName() const;
126
131 void drawGL(const GUIVisualizationSettings& s) const;
132
134
137
138 /* @brief method for getting the Attribute of an XML key
139 * @param[in] key The attribute key
140 * @return string with the value associated to key
141 */
142 std::string getAttribute(SumoXMLAttr key) const override;
143
144 /* @brief method for getting the Attribute of an XML key in double format
145 * @param[in] key The attribute key
146 * @return double with the value associated to key
147 */
148 double getAttributeDouble(SumoXMLAttr key) const override;
149
150 /* @brief method for getting the Attribute of an XML key in position format
151 * @param[in] key The attribute key
152 * @return position with the value associated to key
153 */
154 Position getAttributePosition(SumoXMLAttr key) const override;
155
156 /* @brief method for getting the Attribute of an XML key in positionVector format
157 * @param[in] key The attribute key
158 * @return positionVector with the value associated to key
159 */
161
162 /* @brief method for setting the attribute and letting the object perform additional changes
163 * @param[in] key The attribute key
164 * @param[in] value The new value
165 * @param[in] undoList The undoList on which to register changes
166 */
167 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
168
169 /* @brief method for checking if the key and their correspond attribute are valid
170 * @param[in] key The attribute key
171 * @param[in] value The value associated to key key
172 * @return true if the value is valid, false in other case
173 */
174 bool isValid(SumoXMLAttr key, const std::string& value) override;
175
177 std::string getPopUpID() const override;
178
180 std::string getHierarchyName() const override;
181
183
184protected:
186 double myPosOverLane = 0;
187
189 bool myFriendlyPos = false;
190
193
195 std::string mySpecialPosition;
196
198 double myLength = 0;
199
200private:
202 void setAttribute(SumoXMLAttr key, const std::string& value) override;
203
205 GNEAccess(const GNEAccess&) = delete;
206
208 GNEAccess& operator=(const GNEAccess&) = delete;
209};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
~GNEAccess()
Destructor.
Definition GNEAccess.cpp:60
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this access
Definition GNEAccess.cpp:66
std::string getParentName() const
Returns the name (ID) of the parent object.
Position getAttributePosition(SumoXMLAttr key) const override
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
GNEMoveElementLaneSingle * myMoveElementLaneSingle
move element lane single
Definition GNEAccess.h:192
double getAttributeDouble(SumoXMLAttr key) const override
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
std::string getAttribute(SumoXMLAttr key) const override
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
bool isAccessPositionFixed() const
check if Position of Access is fixed
double myPosOverLane
position over lane
Definition GNEAccess.h:186
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
GNEAccess & operator=(const GNEAccess &)=delete
Invalidated assignment operator.
bool checkDrawMoveContour() const override
check if draw move contour (red)
GNEEdge * getEdge() const
get edge in which this Access is placed
Position getPositionInView() const
Returns position of additional in view.
bool myFriendlyPos
friendly position
Definition GNEAccess.h:189
GNEAccess(const GNEAccess &)=delete
Invalidated copy constructor.
void updateGeometry() override
update pre-computed geometry information
Definition GNEAccess.cpp:84
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
std::string mySpecialPosition
position over lane
Definition GNEAccess.h:195
double myLength
Access length.
Definition GNEAccess.h:198
bool isValid(SumoXMLAttr key, const std::string &value) override
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
Parameterised * getParameters() override
get parameters associated with this access
Definition GNEAccess.cpp:72
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
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.