Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/elements/additional/GNECalibratorFlow.h
194047 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2026 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
/****************************************************************************/
14
/// @file GNECalibratorFlow.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Nov 2015
17
///
18
// Flow used by GNECalibrators
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
#include <utils/vehicle/SUMOVehicleParameter.h>
23
24
#include "GNEAdditional.h"
25
#include "GNEAdditionalListed.h"
26
27
// ===========================================================================
28
// class declaration
29
// ===========================================================================
30
31
class GNECalibrator;
32
class GNECalibratorDialog;
33
34
// ===========================================================================
35
// class definitions
36
// ===========================================================================
37
38
class GNECalibratorFlow : public GNEAdditional, public SUMOVehicleParameter, public GNEAdditionalListed {
39
40
public:
41
/// @brief default constructor
42
GNECalibratorFlow(GNENet* net);
43
44
/// @brief default constructor (used only in GNECalibratorDialog)
45
GNECalibratorFlow(GNEAdditional* calibratorParent, const SUMOTime begin, const SUMOTime end,
46
GNEDemandElement* vehicleType, GNEDemandElement* route);
47
48
/// @brief parameter constructor
49
GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType,
50
GNEDemandElement* route, const SUMOVehicleParameter& vehicleParameters);
51
52
/// @brief destructor
53
~GNECalibratorFlow();
54
55
/// @brief methods to retrieve the elements linked to this calibratorFlow
56
/// @{
57
58
/// @brief get GNEMoveElement associated with this calibratorFlow
59
GNEMoveElement* getMoveElement() const override;
60
61
/// @brief get parameters associated with this calibratorFlow
62
Parameterised* getParameters() override;
63
64
/// @brief get parameters associated with this calibratorFlow
65
const Parameterised* getParameters() const override;
66
67
/// @}
68
69
/// @name members and functions relative to write additionals into XML
70
/// @{
71
72
/**@brief write additional element into a xml file
73
* @param[in] device device in which write parameters of additional element
74
*/
75
void writeAdditional(OutputDevice& device) const override;
76
77
/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)
78
bool isAdditionalValid() const override;
79
80
/// @brief return a string with the current additional problem (must be reimplemented in all detector children)
81
std::string getAdditionalProblem() const override;
82
83
/// @brief fix additional problem (must be reimplemented in all detector children)
84
void fixAdditionalProblem() override;
85
86
/// @}
87
88
/// @name Function related with contour drawing
89
/// @{
90
91
/// @brief check if draw move contour (red)
92
bool checkDrawMoveContour() const override;
93
94
/// @}
95
96
/// @name Functions related with geometry of element
97
/// @{
98
99
/// @brief update pre-computed geometry information
100
void updateGeometry() override;
101
102
/// @brief Returns position of additional in view
103
Position getPositionInView() const override;
104
105
/// @brief update centering boundary (implies change in RTREE)
106
void updateCenteringBoundary(const bool updateGrid) override;
107
108
/// @brief split geometry
109
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;
110
111
/// @}
112
113
/// @name inherited from GUIGlObject
114
/// @{
115
116
/**@brief Returns the name of the parent object
117
* @return This object's parent id
118
*/
119
std::string getParentName() const override;
120
121
/**@brief Draws the object
122
* @param[in] s The settings for the current view (may influence drawing)
123
* @see GUIGlObject::drawGL
124
*/
125
void drawGL(const GUIVisualizationSettings& s) const override;
126
127
/// @}
128
129
/// @brief inherited from GNEAttributeCarrier
130
/// @{
131
132
/* @brief method for getting the Attribute of an XML key
133
* @param[in] key The attribute key
134
* @return string with the value associated to key
135
*/
136
std::string getAttribute(SumoXMLAttr key) const override;
137
138
/* @brief method for getting the Attribute of an XML key in double format
139
* @param[in] key The attribute key
140
* @return double with the value associated to key
141
*/
142
double getAttributeDouble(SumoXMLAttr key) const override;
143
144
/* @brief method for getting the Attribute of an XML key in position format
145
* @param[in] key The attribute key
146
* @return position with the value associated to key
147
*/
148
Position getAttributePosition(SumoXMLAttr key) const override;
149
150
/* @brief method for getting the Attribute of an XML key in positionVector format
151
* @param[in] key The attribute key
152
* @return positionVector with the value associated to key
153
*/
154
PositionVector getAttributePositionVector(SumoXMLAttr key) const override;
155
156
/* @brief method for setting the attribute and letting the object perform additional changes
157
* @param[in] key The attribute key
158
* @param[in] value The new value
159
* @param[in] undoList The undoList on which to register changes
160
* @param[in] net optionally the GNENet to inform about gui updates
161
*/
162
void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
163
164
/* @brief method for setting the attribute and letting the object perform additional changes
165
* @param[in] key The attribute key
166
* @param[in] value The new value
167
* @param[in] undoList The undoList on which to register changes
168
*/
169
bool isValid(SumoXMLAttr key, const std::string& value) override;
170
171
/* @brief method for check if the value for certain attribute is set
172
* @param[in] key The attribute key
173
*/
174
bool isAttributeEnabled(SumoXMLAttr key) const override;
175
176
/// @brief get PopPup ID (Used in AC Hierarchy)
177
std::string getPopUpID() const override;
178
179
/// @brief get Hierarchy Name (Used in AC Hierarchy)
180
std::string getHierarchyName() const override;
181
182
/// @}
183
184
private:
185
/// @brief method for setting the attribute and nothing else
186
void setAttribute(SumoXMLAttr key, const std::string& value) override;
187
188
/// @brief toggle attribute
189
void toggleAttribute(SumoXMLAttr key, const bool value) override;
190
191
/// @brief Invalidated copy constructor.
192
GNECalibratorFlow(const GNECalibratorFlow&) = delete;
193
194
/// @brief Invalidated assignment operator
195
GNECalibratorFlow& operator=(const GNECalibratorFlow&) = delete;
196
};
197
198