Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEVariableSpeedSignStep.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 definitions
27// ===========================================================================
28
30
31public:
34
36 GNEVariableSpeedSignStep(GNEAdditional* variableSpeedSign, const SUMOTime time, const double speed);
37
40
45
48
52 void writeAdditional(OutputDevice& device) const;
53
55 bool isAdditionalValid() const;
56
58 std::string getAdditionalProblem() const;
59
62
64
67
69 bool checkDrawMoveContour() const;
70
72
74 SUMOTime getTime() const;
75
78
80 void updateGeometry();
81
84
86 void updateCenteringBoundary(const bool updateGrid);
87
89 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement,
90 const GNENetworkElement* newElement, GNEUndoList* undoList);
91
93
96
100 std::string getParentName() const;
101
106 void drawGL(const GUIVisualizationSettings& s) const;
107
109
112
113 /* @brief method for getting the Attribute of an XML key
114 * @param[in] key The attribute key
115 * @return string with the value associated to key
116 */
117 std::string getAttribute(SumoXMLAttr key) const;
118
119 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
120 * @param[in] key The attribute key
121 * @return double with the value associated to key
122 */
123 double getAttributeDouble(SumoXMLAttr key) const;
124
127
128 /* @brief method for setting the attribute and letting the object perform additional changes
129 * @param[in] key The attribute key
130 * @param[in] value The new value
131 * @param[in] undoList The undoList on which to register changes
132 * @param[in] net optionally the GNENet to inform about gui updates
133 */
134 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
135
136 /* @brief method for setting the attribute and letting the object perform additional changes
137 * @param[in] key The attribute key
138 * @param[in] value The new value
139 * @param[in] undoList The undoList on which to register changes
140 */
141 bool isValid(SumoXMLAttr key, const std::string& value);
142
144 std::string getPopUpID() const;
145
147 std::string getHierarchyName() const;
148
150
151protected:
154
156 double mySpeed;
157
158private:
160 void setAttribute(SumoXMLAttr key, const std::string& value);
161
163 void setMoveShape(const GNEMoveResult& moveResult);
164
166 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
167
170
173};
long long int SUMOTime
Definition GUI.h:36
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
bool isAdditionalValid() const
check if current additional is valid to be written into XML
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
GNEMoveOperation * getMoveOperation()
get move operation
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double mySpeed
speed in this timeStep
void updateGeometry()
update pre-computed geometry information
Position getPositionInView() const
Returns position of additional in view.
const Parameterised::Map & getACParametersMap() const
get parameters map
GNEVariableSpeedSignStep & operator=(const GNEVariableSpeedSignStep &)=delete
Invalidated assignment operator.
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
SUMOTime getTime() const
get time
GNEVariableSpeedSignStep(const GNEVariableSpeedSignStep &)=delete
Invalidated copy constructor.
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
std::string getParentName() const
Returns the name of the parent object.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void fixAdditionalProblem()
fix additional problem
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
bool checkDrawMoveContour() const
check if draw move contour (red)
std::string getAdditionalProblem() const
return a string with the current additional problem
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
double getAttributeDouble(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