Path: blob/main/src/netedit/changes/GNEChange_Crossing.h
169678 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 GNEChange_Crossing.h14/// @author Pablo Alvarez Lopez15/// @date Oct 201616///17// A network change in which a single crossing is created or deleted18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEChange.h"2324class GNEJunction;2526// ===========================================================================27// class definitions28// ===========================================================================29/**30* @class GNEChange_Crossing31* A network change in which a single crossing is created or deleted32*/33class GNEChange_Crossing : public GNEChange {34// @brief FOX Declaration35FXDECLARE_ABSTRACT(GNEChange_Crossing)3637public:38/**@brief Constructor for creating/deleting an crossing39* @param[in] JunctionParent GNEJunction in which the crossing will be created/deleted40* @param[in] edges vector of edges of crossing41* @param[in] width value with the width of crossing42* @param[in] priority boolean with the priority of crossing43* @param[in] check if in the moment of change connection was selected44* @param[in] forward Whether to create/delete (true/false)45*/46GNEChange_Crossing(GNEJunction* junctionParent, const std::vector<NBEdge*>& edges, double width,47bool priority, int customTLIndex, int customTLIndex2, const PositionVector& customShape, bool selected, bool forward);4849/**@brief Constructor for creating/deleting an crossing based on an existing object50*/51GNEChange_Crossing(GNEJunction* junctionParent, const NBNode::Crossing& crossing, bool forward);5253/// @brief Destructor54~GNEChange_Crossing();5556/// @name inherited from GNEChange57/// @{58/// @brief get undo Name59std::string undoName() const;6061/// @brief get Redo name62std::string redoName() const;6364/// @brief undo action65void undo();6667/// @brief redo action68void redo();69/// @}7071private:72/// @brief full information regarding the Junction in which GNECRossing is created73GNEJunction* myJunctionParent;7475/// @brief vector to save all edges of GNECrossing76std::vector<NBEdge*> myEdges;7778/// @brief width of GNECrossing79double myWidth;8081/// @brief priority of GNECrossing82bool myPriority;8384/// @brief custom index of GNECrossing85int myCustomTLIndex;8687/// @brief custom index of GNECrossing (reverse direction)88int myCustomTLIndex2;8990/// @brief priority of GNECrossing91PositionVector myCustomShape;92};939495