Path: blob/main/src/netedit/elements/additional/GNEClosingLaneReroute.h
194300 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 GNEClosingLaneReroute.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 GNELane;3031// ===========================================================================32// class definitions33// ===========================================================================3435class GNEClosingLaneReroute : public GNEAdditional, public GNEAdditionalListed {3637public:38/// @brief parameter constructor39GNEClosingLaneReroute(GNENet* net);4041/// @brief parameter constructor42GNEClosingLaneReroute(GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions);4344/// @brief destructor45~GNEClosingLaneReroute();4647/// @brief methods to retrieve the elements linked to this closingLaneReroute48/// @{4950/// @brief get GNEMoveElement associated with this closingLaneReroute51GNEMoveElement* getMoveElement() const override;5253/// @brief get parameters associated with this closingLaneReroute54Parameterised* getParameters() override;5556/// @brief get parameters associated with this closingLaneReroute (constant)57const Parameterised* getParameters() const override;5859/// @}6061/// @name members and functions relative to write additionals into XML62/// @{6364/**@brief write additional element into a xml file65* @param[in] device device in which write parameters of additional element66*/67void writeAdditional(OutputDevice& device) const override;6869/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)70bool isAdditionalValid() const override;7172/// @brief return a string with the current additional problem (must be reimplemented in all detector children)73std::string getAdditionalProblem() const override;7475/// @brief fix additional problem (must be reimplemented in all detector children)76void fixAdditionalProblem() override;7778/// @}7980/// @name Function related with contour drawing81/// @{8283/// @brief check if draw move contour (red)84bool checkDrawMoveContour() const override;8586/// @}8788/// @name Functions related with geometry of element89/// @{9091/// @brief update pre-computed geometry information92void updateGeometry() override;9394/// @brief Returns position of additional in view95Position getPositionInView() const override;9697/// @brief update centering boundary (implies change in RTREE)98void updateCenteringBoundary(const bool updateGrid) override;99100/// @brief split geometry101void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;102103/// @}104105/// @name inherited from GUIGlObject106/// @{107108/**@brief Returns the name of the parent object109* @return This object's parent id110*/111std::string getParentName() const override;112113/**@brief Draws the object114* @param[in] s The settings for the current view (may influence drawing)115* @see GUIGlObject::drawGL116*/117void drawGL(const GUIVisualizationSettings& s) const override;118119/// @}120121/// @name inherited from GNEAttributeCarrier122/// @{123124/* @brief method for getting the Attribute of an XML key125* @param[in] key The attribute key126* @return string with the value associated to key127*/128std::string getAttribute(SumoXMLAttr key) const override;129130/* @brief method for getting the Attribute of an XML key in double format131* @param[in] key The attribute key132* @return double with the value associated to key133*/134double getAttributeDouble(SumoXMLAttr key) const override;135136/* @brief method for getting the Attribute of an XML key in position format137* @param[in] key The attribute key138* @return position with the value associated to key139*/140Position getAttributePosition(SumoXMLAttr key) const override;141142/* @brief method for getting the Attribute of an XML key in positionVector format143* @param[in] key The attribute key144* @return positionVector with the value associated to key145*/146PositionVector getAttributePositionVector(SumoXMLAttr key) const override;147148/* @brief method for setting the attribute and letting the object perform additional changes149* @param[in] key The attribute key150* @param[in] value The new value151* @param[in] undoList The undoList on which to register changes152*/153void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;154155/* @brief method for checking if the key and their correspond attribute are valids156* @param[in] key The attribute key157* @param[in] value The value associated to key key158* @return true if the value is valid, false in other case159*/160bool isValid(SumoXMLAttr key, const std::string& value) override;161162/// @brief get PopPup ID (Used in AC Hierarchy)163std::string getPopUpID() const override;164165/// @brief get Hierarchy Name (Used in AC Hierarchy)166std::string getHierarchyName() const override;167168/// @}169170protected:171/// @brief closed lane172GNELane* myClosedLane;173174// @brief Permissions of This Closing Lane Reroute175SVCPermissions myPermissions;176177private:178/// @brief set attribute after validation179void setAttribute(SumoXMLAttr key, const std::string& value) override;180181/// @brief Invalidated copy constructor.182GNEClosingLaneReroute(const GNEClosingLaneReroute&) = delete;183184/// @brief Invalidated assignment operator.185GNEClosingLaneReroute& operator=(const GNEClosingLaneReroute&) = delete;186};187188189