Path: blob/main/src/netedit/elements/moving/GNEMoveElementEdge.h
185790 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 GNEMoveElementEdge.h14/// @author Pablo Alvarez Lopez15/// @date Oct 202516///17// Class used for moving edge shapes18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEMoveElement.h"2324// ===========================================================================25// class definitions26// ===========================================================================2728class GNEEdge;2930// ===========================================================================31// class definitions32// ===========================================================================3334class GNEMoveElementEdge : public GNEMoveElement {3536public:37/// @brief constructor38GNEMoveElementEdge(GNEEdge* edge);3940//// @brief empty destructor41~GNEMoveElementEdge();4243/// @brief get pointer to edge44GNEEdge* getEdge() const;4546/**@brief get move operation47* @note returned GNEMoveOperation can be nullptr48*/49GNEMoveOperation* getMoveOperation() override;5051/// @name functions related with moving attributes52/// @{5354/// @brief get moving attribute55std::string getMovingAttribute(SumoXMLAttr key) const override;5657/// @brief get moving attribute double58double getMovingAttributeDouble(SumoXMLAttr key) const override;5960/// @brief get moving attribute position61Position getMovingAttributePosition(SumoXMLAttr key) const override;6263/// @brief get moving attribute positionVector64PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override;6566/// @brief set moving attribute (using undo-list)67void setMovingAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;6869/// @brief check if the given moving attribute is valid70bool isMovingAttributeValid(SumoXMLAttr key, const std::string& value) const override;7172/// @brief set moving attribute73void setMovingAttribute(SumoXMLAttr key, const std::string& value) override;7475/// @}7677/// @brief remove geometry point in the clicked position78void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) override;7980protected:81/// @brief pointer to edge82GNEEdge* myEdge = nullptr;8384private:85/// @brief set move shape86void setMoveShape(const GNEMoveResult& moveResult) override;8788/// @brief commit move shape89void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;9091/// @brief process moving edge when only from junction is selected92GNEMoveOperation* processMoveFromJunctionSelected(const PositionVector originalShape, const Position mousePosition, const double snapRadius);9394/// @brief process moving edge when only to junction is selected95GNEMoveOperation* processMoveToJunctionSelected(const PositionVector originalShape, const Position mousePosition, const double snapRadius);9697/// @brief process moving edge when both junctions are selected98GNEMoveOperation* processMoveBothJunctionSelected();99100/// @brief process moving edge when none junction are selected101GNEMoveOperation* processNoneJunctionSelected(const double snapRadius);102103/// @brief invalidate default constructor104GNEMoveElementEdge() = delete;105106/// @brief Invalidated copy constructor.107GNEMoveElementEdge(const GNEMoveElementEdge&) = delete;108109/// @brief Invalidated assignment operator.110GNEMoveElementEdge& operator=(const GNEMoveElementEdge&) = delete;111};112113114