Path: blob/main/src/netedit/elements/additional/GNEClosingReroute.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 GNEClosingReroute.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 GNERerouterInterval;29class GNERerouterIntervalDialog;3031// ===========================================================================32// class definitions33// ===========================================================================3435class GNEClosingReroute : public GNEAdditional, public Parameterised {3637public:38/// @brief default constructor39GNEClosingReroute(GNENet* net);4041/// @brief parameter constructor42GNEClosingReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions);4344/// @brief destructor45~GNEClosingReroute();4647/**@brief get move operation48* @note returned GNEMoveOperation can be nullptr49*/50GNEMoveOperation* getMoveOperation();5152/// @name members and functions relative to write additionals into XML53/// @{5455/**@brief write additional element into a xml file56* @param[in] device device in which write parameters of additional element57*/58void writeAdditional(OutputDevice& device) const;5960/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)61bool isAdditionalValid() const;6263/// @brief return a string with the current additional problem (must be reimplemented in all detector children)64std::string getAdditionalProblem() const;6566/// @brief fix additional problem (must be reimplemented in all detector children)67void fixAdditionalProblem();6869/// @}7071/// @name Function related with contour drawing72/// @{7374/// @brief check if draw move contour (red)75bool checkDrawMoveContour() const;7677/// @}7879/// @name Functions related with geometry of element80/// @{8182/// @brief update pre-computed geometry information83void updateGeometry();8485/// @brief Returns position of additional in view86Position getPositionInView() const;8788/// @brief update centering boundary (implies change in RTREE)89void updateCenteringBoundary(const bool updateGrid);9091/// @brief split geometry92void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);9394/// @}9596/// @name inherited from GUIGlObject97/// @{9899/**@brief Returns the name of the parent object100* @return This object's parent id101*/102std::string getParentName() const;103104/**@brief Draws the object105* @param[in] s The settings for the current view (may influence drawing)106* @see GUIGlObject::drawGL107*/108void drawGL(const GUIVisualizationSettings& s) const;109110/// @}111112/// @name inherited from GNEAttributeCarrier113/// @{114115/* @brief method for getting the Attribute of an XML key116* @param[in] key The attribute key117* @return string with the value associated to key118*/119std::string getAttribute(SumoXMLAttr key) const;120121/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)122* @param[in] key The attribute key123* @return double with the value associated to key124*/125double getAttributeDouble(SumoXMLAttr key) const;126127/// @brief get parameters map128const Parameterised::Map& getACParametersMap() const;129130/* @brief method for setting the attribute and letting the object perform additional changes131* @param[in] key The attribute key132* @param[in] value The new value133* @param[in] undoList The undoList on which to register changes134*/135void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);136137/* @brief method for checking if the key and their correspond attribute are valids138* @param[in] key The attribute key139* @param[in] value The value associated to key key140* @return true if the value is valid, false in other case141*/142bool isValid(SumoXMLAttr key, const std::string& value);143144/// @brief get PopPup ID (Used in AC Hierarchy)145std::string getPopUpID() const;146147/// @brief get Hierarchy Name (Used in AC Hierarchy)148std::string getHierarchyName() const;149150/// @}151152protected:153/// @brief closed edge154GNEEdge* myClosedEdge = nullptr;155156// @brief permissions of this Closing Reroute157SVCPermissions myPermissions = SVCAll;158159private:160/// @brief set attribute after validation161void setAttribute(SumoXMLAttr key, const std::string& value);162163/// @brief set move shape164void setMoveShape(const GNEMoveResult& moveResult);165166/// @brief commit move shape167void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);168169/// @brief Invalidated copy constructor.170GNEClosingReroute(const GNEClosingReroute&) = delete;171172/// @brief Invalidated assignment operator.173GNEClosingReroute& operator=(const GNEClosingReroute&) = delete;174};175176177