Path: blob/main/src/netedit/elements/additional/GNECalibratorFlow.h
194047 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GNECalibratorFlow.h14/// @author Pablo Alvarez Lopez15/// @date Nov 201516///17// Flow used by GNECalibrators18/****************************************************************************/19#pragma once20#include <config.h>21#include <utils/vehicle/SUMOVehicleParameter.h>2223#include "GNEAdditional.h"24#include "GNEAdditionalListed.h"2526// ===========================================================================27// class declaration28// ===========================================================================2930class GNECalibrator;31class GNECalibratorDialog;3233// ===========================================================================34// class definitions35// ===========================================================================3637class GNECalibratorFlow : public GNEAdditional, public SUMOVehicleParameter, public GNEAdditionalListed {3839public:40/// @brief default constructor41GNECalibratorFlow(GNENet* net);4243/// @brief default constructor (used only in GNECalibratorDialog)44GNECalibratorFlow(GNEAdditional* calibratorParent, const SUMOTime begin, const SUMOTime end,45GNEDemandElement* vehicleType, GNEDemandElement* route);4647/// @brief parameter constructor48GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType,49GNEDemandElement* route, const SUMOVehicleParameter& vehicleParameters);5051/// @brief destructor52~GNECalibratorFlow();5354/// @brief methods to retrieve the elements linked to this calibratorFlow55/// @{5657/// @brief get GNEMoveElement associated with this calibratorFlow58GNEMoveElement* getMoveElement() const override;5960/// @brief get parameters associated with this calibratorFlow61Parameterised* getParameters() override;6263/// @brief get parameters associated with this calibratorFlow64const Parameterised* getParameters() const override;6566/// @}6768/// @name members and functions relative to write additionals into XML69/// @{7071/**@brief write additional element into a xml file72* @param[in] device device in which write parameters of additional element73*/74void writeAdditional(OutputDevice& device) const override;7576/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)77bool isAdditionalValid() const override;7879/// @brief return a string with the current additional problem (must be reimplemented in all detector children)80std::string getAdditionalProblem() const override;8182/// @brief fix additional problem (must be reimplemented in all detector children)83void fixAdditionalProblem() override;8485/// @}8687/// @name Function related with contour drawing88/// @{8990/// @brief check if draw move contour (red)91bool checkDrawMoveContour() const override;9293/// @}9495/// @name Functions related with geometry of element96/// @{9798/// @brief update pre-computed geometry information99void updateGeometry() override;100101/// @brief Returns position of additional in view102Position getPositionInView() const override;103104/// @brief update centering boundary (implies change in RTREE)105void updateCenteringBoundary(const bool updateGrid) override;106107/// @brief split geometry108void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;109110/// @}111112/// @name inherited from GUIGlObject113/// @{114115/**@brief Returns the name of the parent object116* @return This object's parent id117*/118std::string getParentName() const override;119120/**@brief Draws the object121* @param[in] s The settings for the current view (may influence drawing)122* @see GUIGlObject::drawGL123*/124void drawGL(const GUIVisualizationSettings& s) const override;125126/// @}127128/// @brief inherited from GNEAttributeCarrier129/// @{130131/* @brief method for getting the Attribute of an XML key132* @param[in] key The attribute key133* @return string with the value associated to key134*/135std::string getAttribute(SumoXMLAttr key) const override;136137/* @brief method for getting the Attribute of an XML key in double format138* @param[in] key The attribute key139* @return double with the value associated to key140*/141double getAttributeDouble(SumoXMLAttr key) const override;142143/* @brief method for getting the Attribute of an XML key in position format144* @param[in] key The attribute key145* @return position with the value associated to key146*/147Position getAttributePosition(SumoXMLAttr key) const override;148149/* @brief method for getting the Attribute of an XML key in positionVector format150* @param[in] key The attribute key151* @return positionVector with the value associated to key152*/153PositionVector getAttributePositionVector(SumoXMLAttr key) const override;154155/* @brief method for setting the attribute and letting the object perform additional changes156* @param[in] key The attribute key157* @param[in] value The new value158* @param[in] undoList The undoList on which to register changes159* @param[in] net optionally the GNENet to inform about gui updates160*/161void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;162163/* @brief method for setting the attribute and letting the object perform additional changes164* @param[in] key The attribute key165* @param[in] value The new value166* @param[in] undoList The undoList on which to register changes167*/168bool isValid(SumoXMLAttr key, const std::string& value) override;169170/* @brief method for check if the value for certain attribute is set171* @param[in] key The attribute key172*/173bool isAttributeEnabled(SumoXMLAttr key) const override;174175/// @brief get PopPup ID (Used in AC Hierarchy)176std::string getPopUpID() const override;177178/// @brief get Hierarchy Name (Used in AC Hierarchy)179std::string getHierarchyName() const override;180181/// @}182183private:184/// @brief method for setting the attribute and nothing else185void setAttribute(SumoXMLAttr key, const std::string& value) override;186187/// @brief toggle attribute188void toggleAttribute(SumoXMLAttr key, const bool value) override;189190/// @brief Invalidated copy constructor.191GNECalibratorFlow(const GNECalibratorFlow&) = delete;192193/// @brief Invalidated assignment operator194GNECalibratorFlow& operator=(const GNECalibratorFlow&) = delete;195};196197198