Path: blob/main/src/netedit/elements/additional/GNEParkingAreaReroute.h
194139 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 GNEParkingAreaReroute.h14/// @author Jakob Erdmann15/// @date May 201816///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;32class GNEParkingArea;3334// ===========================================================================35// class definitions36// ===========================================================================3738class GNEParkingAreaReroute : public GNEAdditional, public GNEAdditionalListed {3940public:41/// @brief constructor42GNEParkingAreaReroute(GNENet* net);4344/// @brief constructor45GNEParkingAreaReroute(GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea,46const double probability, const bool visible);4748/// @brief destructor49~GNEParkingAreaReroute();5051/// @brief methods to retrieve the elements linked to this parkingAreaReroute52/// @{5354/// @brief get GNEMoveElement associated with this parkingAreaReroute55GNEMoveElement* getMoveElement() const override;5657/// @brief get parameters associated with this parkingAreaReroute58Parameterised* getParameters() override;5960/// @brief get parameters associated with this parkingAreaReroute (constant)61const Parameterised* getParameters() const override;6263/// @}6465/// @name members and functions relative to write additionals into XML66/// @{6768/**@brief write additional element into a xml file69* @param[in] device device in which write parameters of additional element70*/71void writeAdditional(OutputDevice& device) const override;7273/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)74bool isAdditionalValid() const override;7576/// @brief return a string with the current additional problem (must be reimplemented in all detector children)77std::string getAdditionalProblem() const override;7879/// @brief fix additional problem (must be reimplemented in all detector children)80void fixAdditionalProblem() override;8182/// @}8384/// @name Function related with contour drawing85/// @{8687/// @brief check if draw move contour (red)88bool checkDrawMoveContour() const override;8990/// @}9192/// @name Functions related with geometry of element93/// @{9495/// @brief update pre-computed geometry information96void updateGeometry() override;9798/// @brief Returns position of additional in view99Position getPositionInView() const override;100101/// @brief update centering boundary (implies change in RTREE)102void updateCenteringBoundary(const bool updateGrid) override;103104/// @brief split geometry105void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;106107/// @}108109/// @name inherited from GUIGlObject110/// @{111112/**@brief Returns the name of the parent object113* @return This object's parent id114*/115std::string getParentName() const override;116117/**@brief Draws the object118* @param[in] s The settings for the current view (may influence drawing)119* @see GUIGlObject::drawGL120*/121void drawGL(const GUIVisualizationSettings& s) const override;122123/// @}124125/// @name inherited from GNEAttributeCarrier126/// @{127128/* @brief method for getting the Attribute of an XML key129* @param[in] key The attribute key130* @return string with the value associated to key131*/132std::string getAttribute(SumoXMLAttr key) const override;133134/* @brief method for getting the Attribute of an XML key in double format135* @param[in] key The attribute key136* @return double with the value associated to key137*/138double getAttributeDouble(SumoXMLAttr key) const override;139140/* @brief method for getting the Attribute of an XML key in position format141* @param[in] key The attribute key142* @return position with the value associated to key143*/144Position getAttributePosition(SumoXMLAttr key) const override;145146/* @brief method for getting the Attribute of an XML key in positionVector format147* @param[in] key The attribute key148* @return positionVector with the value associated to key149*/150PositionVector getAttributePositionVector(SumoXMLAttr key) const override;151152/* @brief method for setting the attribute and letting the object perform additional changes153* @param[in] key The attribute key154* @param[in] value The new value155* @param[in] undoList The undoList on which to register changes156*/157void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;158159/* @brief method for checking if the key and their correspond attribute are valids160* @param[in] key The attribute key161* @param[in] value The value associated to key key162* @return true if the value is valid, false in other case163*/164bool isValid(SumoXMLAttr key, const std::string& value) override;165166/// @brief get PopPup ID (Used in AC Hierarchy)167std::string getPopUpID() const override;168169/// @brief get Hierarchy Name (Used in AC Hierarchy)170std::string getHierarchyName() const override;171172/// @}173174protected:175/// @brief probability with which a vehicle will use the given edge as destination176double myProbability = 0;177178/// @brief enable or disable visibility of Parking Area Reroute179bool myVisible = false;180181private:182/// @brief set attribute after validation183void setAttribute(SumoXMLAttr key, const std::string& value) override;184185/// @brief Invalidated copy constructor.186GNEParkingAreaReroute(const GNEParkingAreaReroute&) = delete;187188/// @brief Invalidated assignment operator.189GNEParkingAreaReroute& operator=(const GNEParkingAreaReroute&) = delete;190};191192193