Eclipse SUMO - Simulation of Urban MObility
GNECalibratorFlow.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-2024 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 // Flow used by GNECalibrators
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
23 
24 #include "GNEAdditional.h"
25 
26 // ===========================================================================
27 // class declaration
28 // ===========================================================================
29 
30 class GNECalibrator;
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
41 
42 public:
45 
47  GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route);
48 
50  GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route, const SUMOVehicleParameter& vehicleParameters);
51 
54 
59 
62 
66  void writeAdditional(OutputDevice& device) const;
67 
69  bool isAdditionalValid() const;
70 
72  std::string getAdditionalProblem() const;
73 
75  void fixAdditionalProblem();
76 
78 
81 
83  bool checkDrawMoveContour() const;
84 
86 
89 
91  void updateGeometry();
92 
95 
97  void updateCenteringBoundary(const bool updateGrid);
98 
100  void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
101 
103 
106 
110  std::string getParentName() const;
111 
116  void drawGL(const GUIVisualizationSettings& s) const;
117 
119 
122 
123  /* @brief method for getting the Attribute of an XML key
124  * @param[in] key The attribute key
125  * @return string with the value associated to key
126  */
127  std::string getAttribute(SumoXMLAttr key) const;
128 
129  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
130  * @param[in] key The attribute key
131  * @return double with the value associated to key
132  */
133  double getAttributeDouble(SumoXMLAttr key) const;
134 
136  const Parameterised::Map& getACParametersMap() const;
137 
138  /* @brief method for setting the attribute and letting the object perform additional changes
139  * @param[in] key The attribute key
140  * @param[in] value The new value
141  * @param[in] undoList The undoList on which to register changes
142  * @param[in] net optionally the GNENet to inform about gui updates
143  */
144  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
145 
146  /* @brief method for setting the attribute and letting the object perform additional changes
147  * @param[in] key The attribute key
148  * @param[in] value The new value
149  * @param[in] undoList The undoList on which to register changes
150  */
151  bool isValid(SumoXMLAttr key, const std::string& value);
152 
153  /* @brief method for check if the value for certain attribute is set
154  * @param[in] key The attribute key
155  */
156  bool isAttributeEnabled(SumoXMLAttr key) const;
157 
159  std::string getPopUpID() const;
160 
162  std::string getHierarchyName() const;
163 
165 
166 private:
168  void setAttribute(SumoXMLAttr key, const std::string& value);
169 
171  void setMoveShape(const GNEMoveResult& moveResult);
172 
174  void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
175 
177  void toggleAttribute(SumoXMLAttr key, const bool value);
178 
181 
184 };
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:49
Dialog for edit calibrators.
GNECalibratorFlow & operator=(const GNECalibratorFlow &)=delete
Invalidated assignment operator.
const Parameterised::Map & getACParametersMap() const
get parameters map
double getAttributeDouble(SumoXMLAttr key) const
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
GNECalibratorFlow(GNENet *net)
default constructor
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void toggleAttribute(SumoXMLAttr key, const bool value)
toggle attribute
~GNECalibratorFlow()
destructor
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
GNEMoveOperation * getMoveOperation()
get move operation
void updateGeometry()
update pre-computed geometry information
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Position getPositionInView() const
Returns position of additional in view.
bool isAttributeEnabled(SumoXMLAttr key) const
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
GNECalibratorFlow(const GNECalibratorFlow &)=delete
Invalidated copy constructor.
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
bool checkDrawMoveContour() const
check if draw move contour (red)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
std::string getParentName() const
Returns the name of the parent object.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
move operation
move result
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.
Definition: OutputDevice.h:61
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
Structure representing possible vehicle parameter.