Path: blob/main/src/netedit/elements/additional/GNEDestProbReroute.h
194760 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 GNEDestProbReroute.h14/// @author Pablo Alvarez Lopez15/// @date Jan 201716///17//18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEAdditional.h"23#include "GNEAdditionalListed.h"2425// ===========================================================================26// class declarations27// ===========================================================================2829class GNEEdge;30class GNERerouterInterval;31class GNERerouterIntervalDialog;3233// ===========================================================================34// class definitions35// ===========================================================================3637class GNEDestProbReroute : public GNEAdditional, public GNEAdditionalListed {3839public:40/// @brief constructor41GNEDestProbReroute(GNENet* net);4243/// @brief constructor44GNEDestProbReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability);4546/// @brief destructor47~GNEDestProbReroute();4849/// @brief methods to retrieve the elements linked to this destProbReroute50/// @{5152/// @brief get GNEMoveElement associated with this destProbReroute53GNEMoveElement* getMoveElement() const override;5455/// @brief get parameters associated with this destProbReroute56Parameterised* getParameters() override;5758/// @brief get parameters associated with this destProbReroute (constant)59const Parameterised* getParameters() const override;6061/// @}6263/// @name members and functions relative to write additionals into XML64/// @{6566/**@brief write additional element into a xml file67* @param[in] device device in which write parameters of additional element68*/69void writeAdditional(OutputDevice& device) const override;7071/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)72bool isAdditionalValid() const override;7374/// @brief return a string with the current additional problem (must be reimplemented in all detector children)75std::string getAdditionalProblem() const override;7677/// @brief fix additional problem (must be reimplemented in all detector children)78void fixAdditionalProblem() override;7980/// @}8182/// @name Function related with contour drawing83/// @{8485/// @brief check if draw move contour (red)86bool checkDrawMoveContour() const override;8788/// @}8990/// @name Functions related with geometry of element91/// @{9293/// @brief update pre-computed geometry information94void updateGeometry() override;9596/// @brief Returns position of additional in view97Position getPositionInView() const override;9899/// @brief update centering boundary (implies change in RTREE)100void updateCenteringBoundary(const bool updateGrid) override;101102/// @brief split geometry103void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;104105/// @}106107/// @name inherited from GUIGlObject108/// @{109110/**@brief Returns the name of the parent object111* @return This object's parent id112*/113std::string getParentName() const override;114115/**@brief Draws the object116* @param[in] s The settings for the current view (may influence drawing)117* @see GUIGlObject::drawGL118*/119void drawGL(const GUIVisualizationSettings& s) const override;120121/// @}122123/// @name inherited from GNEAttributeCarrier124/// @{125126/* @brief method for getting the Attribute of an XML key127* @param[in] key The attribute key128* @return string with the value associated to key129*/130std::string getAttribute(SumoXMLAttr key) const override;131132/* @brief method for getting the Attribute of an XML key in double format133* @param[in] key The attribute key134* @return double with the value associated to key135*/136double getAttributeDouble(SumoXMLAttr key) const override;137138/* @brief method for getting the Attribute of an XML key in position format139* @param[in] key The attribute key140* @return position with the value associated to key141*/142Position getAttributePosition(SumoXMLAttr key) const override;143144/* @brief method for getting the Attribute of an XML key in positionVector format145* @param[in] key The attribute key146* @return positionVector with the value associated to key147*/148PositionVector getAttributePositionVector(SumoXMLAttr key) const override;149150/* @brief method for setting the attribute and letting the object perform additional changes151* @param[in] key The attribute key152* @param[in] value The new value153* @param[in] undoList The undoList on which to register changes154*/155void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;156157/* @brief method for checking if the key and their correspond attribute are valids158* @param[in] key The attribute key159* @param[in] value The value associated to key key160* @return true if the value is valid, false in other case161*/162bool isValid(SumoXMLAttr key, const std::string& value) override;163164/// @brief get PopPup ID (Used in AC Hierarchy)165std::string getPopUpID() const override;166167/// @brief get Hierarchy Name (Used in AC Hierarchy)168std::string getHierarchyName() const override;169170/// @}171172protected:173/// @brief id of new edge destination174GNEEdge* myNewEdgeDestination;175176/// @brief probability with which a vehicle will use the given edge as destination177double myProbability;178179private:180/// @brief set attribute after validation181void setAttribute(SumoXMLAttr key, const std::string& value) override;182183/// @brief Invalidated copy constructor.184GNEDestProbReroute(const GNEDestProbReroute&) = delete;185186/// @brief Invalidated assignment operator.187GNEDestProbReroute& operator=(const GNEDestProbReroute&) = delete;188};189190191