Path: blob/main/src/netedit/elements/additional/GNEParkingAreaReroute.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 GNEParkingAreaReroute.h14/// @author Jakob Erdmann15/// @date May 201816///17//18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEAdditional.h"2324// ===========================================================================25// class declarations26// ===========================================================================2728class GNEEdge;29class GNERerouterInterval;30class GNERerouterIntervalDialog;31class GNEParkingArea;3233// ===========================================================================34// class definitions35// ===========================================================================3637class GNEParkingAreaReroute : public GNEAdditional, public Parameterised {3839public:40/// @brief constructor41GNEParkingAreaReroute(GNENet* net);4243/// @brief constructor44GNEParkingAreaReroute(GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea,45const double probability, const bool visible);4647/// @brief destructor48~GNEParkingAreaReroute();4950/**@brief get move operation51* @note returned GNEMoveOperation can be nullptr52*/53GNEMoveOperation* getMoveOperation();5455/// @name members and functions relative to write additionals into XML56/// @{5758/**@brief write additional element into a xml file59* @param[in] device device in which write parameters of additional element60*/61void writeAdditional(OutputDevice& device) const;6263/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)64bool isAdditionalValid() const;6566/// @brief return a string with the current additional problem (must be reimplemented in all detector children)67std::string getAdditionalProblem() const;6869/// @brief fix additional problem (must be reimplemented in all detector children)70void fixAdditionalProblem();7172/// @}7374/// @name Function related with contour drawing75/// @{7677/// @brief check if draw move contour (red)78bool checkDrawMoveContour() const;7980/// @}8182/// @name Functions related with geometry of element83/// @{8485/// @brief update pre-computed geometry information86void updateGeometry();8788/// @brief Returns position of additional in view89Position getPositionInView() const;9091/// @brief update centering boundary (implies change in RTREE)92void updateCenteringBoundary(const bool updateGrid);9394/// @brief split geometry95void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);9697/// @}9899/// @name inherited from GUIGlObject100/// @{101102/**@brief Returns the name of the parent object103* @return This object's parent id104*/105std::string getParentName() const;106107/**@brief Draws the object108* @param[in] s The settings for the current view (may influence drawing)109* @see GUIGlObject::drawGL110*/111void drawGL(const GUIVisualizationSettings& s) const;112113/// @}114115/// @name inherited from GNEAttributeCarrier116/// @{117118/* @brief method for getting the Attribute of an XML key119* @param[in] key The attribute key120* @return string with the value associated to key121*/122std::string getAttribute(SumoXMLAttr key) const;123124/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)125* @param[in] key The attribute key126* @return double with the value associated to key127*/128double getAttributeDouble(SumoXMLAttr key) const;129130/// @brief get parameters map131const Parameterised::Map& getACParametersMap() const;132133/* @brief method for setting the attribute and letting the object perform additional changes134* @param[in] key The attribute key135* @param[in] value The new value136* @param[in] undoList The undoList on which to register changes137*/138void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);139140/* @brief method for checking if the key and their correspond attribute are valids141* @param[in] key The attribute key142* @param[in] value The value associated to key key143* @return true if the value is valid, false in other case144*/145bool isValid(SumoXMLAttr key, const std::string& value);146147/// @brief get PopPup ID (Used in AC Hierarchy)148std::string getPopUpID() const;149150/// @brief get Hierarchy Name (Used in AC Hierarchy)151std::string getHierarchyName() const;152153/// @}154155protected:156/// @brief probability with which a vehicle will use the given edge as destination157double myProbability = 0;158159/// @brief enable or disable visibility of Parking Area Reroute160bool myVisible = false;161162private:163/// @brief set attribute after validation164void 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 Invalidated copy constructor.173GNEParkingAreaReroute(const GNEParkingAreaReroute&) = delete;174175/// @brief Invalidated assignment operator.176GNEParkingAreaReroute& operator=(const GNEParkingAreaReroute&) = delete;177};178179180