Path: blob/main/src/netedit/elements/additional/GNEClosingReroute.h
193969 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 GNEClosingReroute.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 GNERerouterInterval;30class GNERerouterIntervalDialog;3132// ===========================================================================33// class definitions34// ===========================================================================3536class GNEClosingReroute : public GNEAdditional, public GNEAdditionalListed {3738public:39/// @brief default constructor40GNEClosingReroute(GNENet* net);4142/// @brief parameter constructor43GNEClosingReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions);4445/// @brief destructor46~GNEClosingReroute();4748/// @brief methods to retrieve the elements linked to this closingReroute49/// @{5051/// @brief get GNEMoveElement associated with this closingReroute52GNEMoveElement* getMoveElement() const override;5354/// @brief get parameters associated with this closingReroute55Parameterised* getParameters() override;5657/// @brief get parameters associated with this closingReroute (constant)58const Parameterised* getParameters() const override;5960/// @}6162/// @name members and functions relative to write additionals into XML63/// @{6465/**@brief write additional element into a xml file66* @param[in] device device in which write parameters of additional element67*/68void writeAdditional(OutputDevice& device) const override;6970/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)71bool isAdditionalValid() const override;7273/// @brief return a string with the current additional problem (must be reimplemented in all detector children)74std::string getAdditionalProblem() const override;7576/// @brief fix additional problem (must be reimplemented in all detector children)77void fixAdditionalProblem() override;7879/// @}8081/// @name Function related with contour drawing82/// @{8384/// @brief check if draw move contour (red)85bool checkDrawMoveContour() const override;8687/// @}8889/// @name Functions related with geometry of element90/// @{9192/// @brief update pre-computed geometry information93void updateGeometry() override;9495/// @brief Returns position of additional in view96Position getPositionInView() const override;9798/// @brief update centering boundary (implies change in RTREE)99void updateCenteringBoundary(const bool updateGrid) override;100101/// @brief split geometry102void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;103104/// @}105106/// @name inherited from GUIGlObject107/// @{108109/**@brief Returns the name of the parent object110* @return This object's parent id111*/112std::string getParentName() const override;113114/**@brief Draws the object115* @param[in] s The settings for the current view (may influence drawing)116* @see GUIGlObject::drawGL117*/118void drawGL(const GUIVisualizationSettings& s) const override;119120/// @}121122/// @name inherited from GNEAttributeCarrier123/// @{124125/* @brief method for getting the Attribute of an XML key126* @param[in] key The attribute key127* @return string with the value associated to key128*/129std::string getAttribute(SumoXMLAttr key) const override;130131/* @brief method for getting the Attribute of an XML key in double format132* @param[in] key The attribute key133* @return double with the value associated to key134*/135double getAttributeDouble(SumoXMLAttr key) const override;136137/* @brief method for getting the Attribute of an XML key in position format138* @param[in] key The attribute key139* @return position with the value associated to key140*/141Position getAttributePosition(SumoXMLAttr key) const override;142143/* @brief method for getting the Attribute of an XML key in positionVector format144* @param[in] key The attribute key145* @return positionVector with the value associated to key146*/147PositionVector getAttributePositionVector(SumoXMLAttr key) const override;148149/* @brief method for setting the attribute and letting the object perform additional changes150* @param[in] key The attribute key151* @param[in] value The new value152* @param[in] undoList The undoList on which to register changes153*/154void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;155156/* @brief method for checking if the key and their correspond attribute are valids157* @param[in] key The attribute key158* @param[in] value The value associated to key key159* @return true if the value is valid, false in other case160*/161bool isValid(SumoXMLAttr key, const std::string& value) override;162163/// @brief get PopPup ID (Used in AC Hierarchy)164std::string getPopUpID() const override;165166/// @brief get Hierarchy Name (Used in AC Hierarchy)167std::string getHierarchyName() const override;168169/// @}170171protected:172/// @brief closed edge173GNEEdge* myClosedEdge = nullptr;174175// @brief permissions of this Closing Reroute176SVCPermissions myPermissions = SVCAll;177178private:179/// @brief set attribute after validation180void setAttribute(SumoXMLAttr key, const std::string& value) override;181182/// @brief Invalidated copy constructor.183GNEClosingReroute(const GNEClosingReroute&) = delete;184185/// @brief Invalidated assignment operator.186GNEClosingReroute& operator=(const GNEClosingReroute&) = delete;187};188189190