Path: blob/main/src/netedit/elements/moving/GNEMoveElementShape.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 GNEMoveElementShape.h14/// @author Pablo Alvarez Lopez15/// @date Sep 202516///17// Class used for shape elements that can be moved over view18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEMoveElement.h"2324// ===========================================================================25// class definitions26// ===========================================================================2728class GNEMoveElementShape : public GNEMoveElement {2930public:31/// @brief constructor32GNEMoveElementShape(GNEAttributeCarrier* element);3334/// @brief constructor35GNEMoveElementShape(GNEAttributeCarrier* element, PositionVector& shape, const bool alwaysClosed);3637/// @brief constructor38GNEMoveElementShape(GNEAttributeCarrier* element, PositionVector& shape, const Position& position, const bool alwaysClosed);3940//// @brief empty destructor41~GNEMoveElementShape();4243/**@brief get move operation44* @note returned GNEMoveOperation can be nullptr45*/46GNEMoveOperation* getMoveOperation() override;4748/// @name functions related with moving attributes49/// @{5051/// @brief get moving attribute52std::string getMovingAttribute(SumoXMLAttr key) const override;5354/// @brief get moving attribute double55double getMovingAttributeDouble(SumoXMLAttr key) const override;5657/// @brief get moving attribute position58Position getMovingAttributePosition(SumoXMLAttr key) const override;5960/// @brief get moving attribute position vector61PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override;6263/// @brief set moving attribute (using undo-list)64void setMovingAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;6566/// @brief check if the given moving attribute is valid67bool isMovingAttributeValid(SumoXMLAttr key, const std::string& value) const override;6869/// @brief set moving attribute70void setMovingAttribute(SumoXMLAttr key, const std::string& value) override;7172/// @}7374/// @brief remove geometry point in the clicked position75void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) override;767778//protected:79/// @brief center position80Position myCenterPosition;8182private:83/// @brief reference to Shape84PositionVector& myMovingShape;8586/// @brief empty position vector87static PositionVector EMPTY_SHAPE;8889/// @brief check if shape must be always closed90const bool myAlwaysClosed = false;9192/// @brief set move shape93void setMoveShape(const GNEMoveResult& moveResult) override;9495/// @brief commit move shape96void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;9798/// @brief Invalidated copy constructor.99GNEMoveElementShape(const GNEMoveElementShape&) = delete;100101/// @brief Invalidated assignment operator.102GNEMoveElementShape& operator=(const GNEMoveElementShape&) = delete;103};104105106