Path: blob/main/src/netedit/elements/moving/GNEMoveElementView.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 GNEMoveElementView.h14/// @author Pablo Alvarez Lopez15/// @date Sep 202516///17// Class used for elements that can be moved over view18/****************************************************************************/19#pragma once20#include <config.h>2122#include <netedit/elements/GNEContour.h>2324#include "GNEMoveElement.h"2526// ===========================================================================27// class definitions28// ===========================================================================2930class GNEMoveElementView : public GNEMoveElement {3132public:33/// @brief resizable needs access34friend class GNEMoveElementViewResizable;3536/// @brief attributes format37enum class AttributesFormat {38POSITION, /// @brief position format39CARTESIAN, /// @brief cartesian format (x, y, z)40GEO /// @brief geo format (lon, lat, z)41};4243/// @brief constructor for element with fixed size44GNEMoveElementView(GNEAttributeCarrier* element, AttributesFormat attributesFormat,45SumoXMLAttr posAttr, Position& position);4647//// @brief empty destructor48~GNEMoveElementView();4950/**@brief get move operation51* @note returned GNEMoveOperation can be nullptr52*/53GNEMoveOperation* getMoveOperation() override;5455/// @name functions related with moving attributes56/// @{5758/// @brief get moving attribute59std::string getMovingAttribute(SumoXMLAttr key) const override;6061/// @brief get moving attribute double62double getMovingAttributeDouble(SumoXMLAttr key) const override;6364/// @brief get moving attribute position65Position getMovingAttributePosition(SumoXMLAttr key) const override;6667/// @brief get moving attribute positionVector68PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override;6970/// @brief set moving attribute (using undo-list)71void setMovingAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;7273/// @brief check if the given moving attribute is valid74bool isMovingAttributeValid(SumoXMLAttr key, const std::string& value) const override;7576/// @brief set moving attribute77void setMovingAttribute(SumoXMLAttr key, const std::string& value) override;7879/// @}8081/// @brief remove geometry point in the clicked position82void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) override;8384/// @brief write move attributes85void writeMoveAttributes(OutputDevice& device) const;8687private:88/// @brief pos attribute89SumoXMLAttr myPosAttr;9091/// @brief position over view92Position& myPosOverView;9394/// @brief set move shape95void setMoveShape(const GNEMoveResult& moveResult) override;9697/// @brief commit move shape98void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;99100/// @brief pos attributes format101AttributesFormat myAttributesFormat = AttributesFormat::POSITION;102103/// @brief Invalidated copy constructor.104GNEMoveElementView(const GNEMoveElementView&) = delete;105106/// @brief Invalidated assignment operator.107GNEMoveElementView& operator=(const GNEMoveElementView&) = delete;108};109110111