Path: blob/main/src/netedit/elements/additional/GNEClosingLaneReroute.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 GNEClosingLaneReroute.h14/// @author Pablo Alvarez Lopez15/// @date Jan 201716///17//18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEAdditional.h"2324// ===========================================================================25// class declarations26// ===========================================================================2728class GNELane;29class GNERerouterInterval;30class GNERerouterIntervalDialog;3132// ===========================================================================33// class definitions34// ===========================================================================353637class GNEClosingLaneReroute : public GNEAdditional, public Parameterised {3839public:40/// @brief parameter constructor41GNEClosingLaneReroute(GNENet* net);4243/// @brief parameter constructor44GNEClosingLaneReroute(GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions);4546/// @brief destructor47~GNEClosingLaneReroute();4849/**@brief get move operation50* @note returned GNEMoveOperation can be nullptr51*/52GNEMoveOperation* getMoveOperation();5354/// @name members and functions relative to write additionals into XML55/// @{5657/**@brief write additional element into a xml file58* @param[in] device device in which write parameters of additional element59*/60void writeAdditional(OutputDevice& device) const;6162/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)63bool isAdditionalValid() const;6465/// @brief return a string with the current additional problem (must be reimplemented in all detector children)66std::string getAdditionalProblem() const;6768/// @brief fix additional problem (must be reimplemented in all detector children)69void fixAdditionalProblem();7071/// @}7273/// @name Function related with contour drawing74/// @{7576/// @brief check if draw move contour (red)77bool checkDrawMoveContour() const;7879/// @}8081/// @name Functions related with geometry of element82/// @{8384/// @brief update pre-computed geometry information85void updateGeometry();8687/// @brief Returns position of additional in view88Position getPositionInView() const;8990/// @brief update centering boundary (implies change in RTREE)91void updateCenteringBoundary(const bool updateGrid);9293/// @brief split geometry94void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);9596/// @}9798/// @name inherited from GUIGlObject99/// @{100101/**@brief Returns the name of the parent object102* @return This object's parent id103*/104std::string getParentName() const;105106/**@brief Draws the object107* @param[in] s The settings for the current view (may influence drawing)108* @see GUIGlObject::drawGL109*/110void drawGL(const GUIVisualizationSettings& s) const;111112/// @}113114/// @name inherited from GNEAttributeCarrier115/// @{116117/* @brief method for getting the Attribute of an XML key118* @param[in] key The attribute key119* @return string with the value associated to key120*/121std::string getAttribute(SumoXMLAttr key) const;122123/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)124* @param[in] key The attribute key125* @return double with the value associated to key126*/127double getAttributeDouble(SumoXMLAttr key) const;128129/// @brief get parameters map130const Parameterised::Map& getACParametersMap() const;131132/* @brief method for setting the attribute and letting the object perform additional changes133* @param[in] key The attribute key134* @param[in] value The new value135* @param[in] undoList The undoList on which to register changes136*/137void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);138139/* @brief method for checking if the key and their correspond attribute are valids140* @param[in] key The attribute key141* @param[in] value The value associated to key key142* @return true if the value is valid, false in other case143*/144bool isValid(SumoXMLAttr key, const std::string& value);145146/// @brief get PopPup ID (Used in AC Hierarchy)147std::string getPopUpID() const;148149/// @brief get Hierarchy Name (Used in AC Hierarchy)150std::string getHierarchyName() const;151152/// @}153154protected:155/// @brief closed lane156GNELane* myClosedLane;157158// @brief Permissions of This Closing Lane Reroute159SVCPermissions myPermissions;160161private:162/// @brief set attribute after validation163void setAttribute(SumoXMLAttr key, const std::string& value);164165/// @brief set move shape166void setMoveShape(const GNEMoveResult& moveResult);167168/// @brief commit move shape169void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);170171/// @brief Invalidated copy constructor.172GNEClosingLaneReroute(const GNEClosingLaneReroute&) = delete;173174/// @brief Invalidated assignment operator.175GNEClosingLaneReroute& operator=(const GNEClosingLaneReroute&) = delete;176};177178179