Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNERouteProbe.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
47 GNERouteProbe(const std::string& id, GNENet* net, const std::string& filename, GNEEdge* edge, const SUMOTime period,
48 const std::string& name, const std::string& outputFilename, SUMOTime begin, const std::vector<std::string>& vehicleTypes,
49 const Parameterised::Map& parameters);
50
53
56
58 GNEMoveElement* getMoveElement() const override;
59
61 Parameterised* getParameters() override;
62
64 const Parameterised* getParameters() const override;
65
67
70
74 void writeAdditional(OutputDevice& device) const;
75
77 bool isAdditionalValid() const;
78
80 std::string getAdditionalProblem() const;
81
84
86
89
91 bool checkDrawMoveContour() const override;
92
94
99
102
104 void updateGeometry() override;
105
108
110 void updateCenteringBoundary(const bool updateGrid);
111
113 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
114
116
119
122 std::string getParentName() const;
123
128 void drawGL(const GUIVisualizationSettings& s) const;
129
131
134
135 /* @brief method for getting the Attribute of an XML key
136 * @param[in] key The attribute key
137 * @return string with the value associated to key
138 */
139 std::string getAttribute(SumoXMLAttr key) const override;
140
141 /* @brief method for getting the Attribute of an XML key in double format
142 * @param[in] key The attribute key
143 * @return double with the value associated to key
144 */
145 double getAttributeDouble(SumoXMLAttr key) const override;
146
147 /* @brief method for getting the Attribute of an XML key in position format
148 * @param[in] key The attribute key
149 * @return position with the value associated to key
150 */
151 Position getAttributePosition(SumoXMLAttr key) const override;
152
153 /* @brief method for getting the Attribute of an XML key in positionVector format
154 * @param[in] key The attribute key
155 * @return positionVector with the value associated to key
156 */
158
159 /* @brief method for setting the attribute and letting the object perform additional changes
160 * @param[in] key The attribute key
161 * @param[in] value The new value
162 * @param[in] undoList The undoList on which to register changes
163 */
164 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
165
166 /* @brief method for checking if the key and their correspond attribute are valids
167 * @param[in] key The attribute key
168 * @param[in] value The value associated to key key
169 * @return true if the value is valid, false in other case
170 */
171 bool isValid(SumoXMLAttr key, const std::string& value) override;
172
174 std::string getPopUpID() const override;
175
177 std::string getHierarchyName() const override;
178
180
181protected:
184
186 std::string myOutputFilename;
187
190
192 std::vector<std::string> myVehicleTypes;
193
196
199
200private:
202 void setAttribute(SumoXMLAttr key, const std::string& value) override;
203
205 GNERouteProbe(const GNERouteProbe&) = delete;
206
209};
long long int SUMOTime
Definition GUI.h:36
#define SUMOTime_MAX_PERIOD
Definition SUMOTime.h:36
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
SUMOTime myBegin
begin of rerouter
GNERouteProbe & operator=(const GNERouteProbe &)=delete
Invalidated assignment operator.
std::vector< std::string > myVehicleTypes
vehicle types
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
bool checkDrawMoveContour() const override
check if draw move contour (red)
Position getPositionInView() const
Returns position of additional in view.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
std::string getParentName() const
Returns the name of the parent object.
std::string getAttribute(SumoXMLAttr key) const override
GNERouteProbe(const GNERouteProbe &)=delete
Invalidated copy constructor.
SUMOTime myPeriod
RouteProbe period.
GNEMoveOperation * getMoveOperation()
get move operation
double getAttributeDouble(SumoXMLAttr key) const override
std::string myOutputFilename
output filename
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Parameterised * getParameters() override
get parameters associated with this routeProbe
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
~GNERouteProbe()
Destructor.
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
Position myRouteProbeLogoOffset
route probe logo offset
GNEContour mySymbolBaseContour
symbol base contour
void updateGeometry() override
update pre-computed geometry information
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this routeProbe
bool isValid(SumoXMLAttr key, const std::string &value) override
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
Position getAttributePosition(SumoXMLAttr key) const override
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
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.