Path: blob/main/src/netedit/elements/additional/GNECalibratorFlow.h
169684 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 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"2425// ===========================================================================26// class declaration27// ===========================================================================2829class GNECalibrator;30class GNECalibratorDialog;3132// ===========================================================================33// class definitions34// ===========================================================================3536class GNECalibratorFlow : public GNEAdditional, public SUMOVehicleParameter {3738public:39/// @brief default constructor40GNECalibratorFlow(GNENet* net);4142/// @brief default constructor (used only in GNECalibratorDialog)43GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route);4445/// @brief parameter constructor46GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route, const SUMOVehicleParameter& vehicleParameters);4748/// @brief destructor49~GNECalibratorFlow();5051/**@brief get move operation52* @note returned GNEMoveOperation can be nullptr53*/54GNEMoveOperation* getMoveOperation();5556/// @name members and functions relative to write additionals into XML57/// @{5859/**@brief write additional element into a xml file60* @param[in] device device in which write parameters of additional element61*/62void writeAdditional(OutputDevice& device) const;6364/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)65bool isAdditionalValid() const;6667/// @brief return a string with the current additional problem (must be reimplemented in all detector children)68std::string getAdditionalProblem() const;6970/// @brief fix additional problem (must be reimplemented in all detector children)71void fixAdditionalProblem();7273/// @}7475/// @name Function related with contour drawing76/// @{7778/// @brief check if draw move contour (red)79bool checkDrawMoveContour() const;8081/// @}8283/// @name Functions related with geometry of element84/// @{8586/// @brief update pre-computed geometry information87void updateGeometry();8889/// @brief Returns position of additional in view90Position getPositionInView() const;9192/// @brief update centering boundary (implies change in RTREE)93void updateCenteringBoundary(const bool updateGrid);9495/// @brief split geometry96void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);9798/// @}99100/// @name inherited from GUIGlObject101/// @{102103/**@brief Returns the name of the parent object104* @return This object's parent id105*/106std::string getParentName() const;107108/**@brief Draws the object109* @param[in] s The settings for the current view (may influence drawing)110* @see GUIGlObject::drawGL111*/112void drawGL(const GUIVisualizationSettings& s) const;113114/// @}115116/// @brief inherited from GNEAttributeCarrier117/// @{118119/* @brief method for getting the Attribute of an XML key120* @param[in] key The attribute key121* @return string with the value associated to key122*/123std::string getAttribute(SumoXMLAttr key) const;124125/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)126* @param[in] key The attribute key127* @return double with the value associated to key128*/129double getAttributeDouble(SumoXMLAttr key) const;130131/// @brief get parameters map132const Parameterised::Map& getACParametersMap() const;133134/* @brief method for setting the attribute and letting the object perform additional changes135* @param[in] key The attribute key136* @param[in] value The new value137* @param[in] undoList The undoList on which to register changes138* @param[in] net optionally the GNENet to inform about gui updates139*/140void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);141142/* @brief method for setting the attribute and letting the object perform additional changes143* @param[in] key The attribute key144* @param[in] value The new value145* @param[in] undoList The undoList on which to register changes146*/147bool isValid(SumoXMLAttr key, const std::string& value);148149/* @brief method for check if the value for certain attribute is set150* @param[in] key The attribute key151*/152bool isAttributeEnabled(SumoXMLAttr key) const;153154/// @brief get PopPup ID (Used in AC Hierarchy)155std::string getPopUpID() const;156157/// @brief get Hierarchy Name (Used in AC Hierarchy)158std::string getHierarchyName() const;159160/// @}161162private:163/// @brief method for setting the attribute and nothing else164void setAttribute(SumoXMLAttr key, const std::string& value);165166/// @brief set move shape167void setMoveShape(const GNEMoveResult& moveResult);168169/// @brief commit move shape170void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);171172/// @brief toggle attribute173void toggleAttribute(SumoXMLAttr key, const bool value);174175/// @brief Invalidated copy constructor.176GNECalibratorFlow(const GNECalibratorFlow&) = delete;177178/// @brief Invalidated assignment operator179GNECalibratorFlow& operator=(const GNECalibratorFlow&) = delete;180};181182183