Path: blob/main/src/netedit/elements/moving/GNEMoveElementLaneDouble.h
185851 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 GNEMoveElementLaneDouble.h14/// @author Pablo Alvarez Lopez15/// @date Sep 202516///17// Class used for elements that can be moved over a lane with two positions18/****************************************************************************/19#pragma once20#include <config.h>2122#include <utils/iodevices/OutputDevice.h>2324#include "GNEMoveElement.h"2526// ===========================================================================27// class declaration28// ===========================================================================2930class GNEMoveElementLaneSingle;3132// ===========================================================================33// class definitions34// ===========================================================================3536class GNEMoveElementLaneDouble : public GNEMoveElement {3738public:39/**@brief Constructor40* @param[in] element moved element41* @param[in] startPosAttr Start position attribute42* @param[in] startPosValue Start position value43* @param[in] endPosAttr End position attribute44* @param[in] endPosValue End position value45* @param[in] friendlyPos enable or disable friendly position46*/47GNEMoveElementLaneDouble(GNEAttributeCarrier* element, SumoXMLAttr startPosAttr,48double& startPosValue, SumoXMLAttr endPosAttr,49double& endPosValue, bool& friendlyPosition);5051/// @brief Destructor52~GNEMoveElementLaneDouble();5354/**@brief get lane movable move operation for elements with55* @note returned GNEMoveOperation can be nullptr56*/57GNEMoveOperation* getMoveOperation() override;5859/// @name functions related with moving attributes60/// @{6162/// @brief get moving attribute63std::string getMovingAttribute(SumoXMLAttr key) const override;6465/// @brief get moving attribute double66double getMovingAttributeDouble(SumoXMLAttr key) const override;6768/// @brief get moving attribute position69Position getMovingAttributePosition(SumoXMLAttr key) const override;7071/// @brief get moving attribute positionVector72PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override;7374/// @brief set moving attribute (using undo-list)75void setMovingAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;7677/// @brief check if the given moving attribute is valid78bool isMovingAttributeValid(SumoXMLAttr key, const std::string& value) const override;7980/// @brief set moving attribute81void setMovingAttribute(SumoXMLAttr key, const std::string& value) override;8283/// @}8485/// @brief remove geometry point in the clicked position86void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) override;8788/// @brief check if current moving element is valid to be written into XML89bool isMoveElementValid() const;9091/// @brief return a string with the current moving problem92std::string getMovingProblem() const;9394/// @brief fix moving problem95void fixMovingProblem();9697/// @brief write move attributes98void writeMoveAttributes(OutputDevice& device, const bool writeLength) const;99100/// @brief get start offset position over lane101double getStartFixedPositionOverLane(const bool adjustGeometryFactor) const;102103/// @brief get end offset position over lane104double getEndFixedPositionOverLane(const bool adjustGeometryFactor) const;105106/// @brief default element size107static const double defaultSize;108109private:110/// @brief start position111GNEMoveElementLaneSingle* myStartPos;112113/// @brief end position114GNEMoveElementLaneSingle* myEndPos;115116/// @brief size (only use in AttributeCarrier templates)117double myTemplateSize = defaultSize;118119/// @brief force size (only used in AttributeCarrier templates120bool myTemplateForceSize = false;121122/// @brief reference position123ReferencePosition myReferencePosition = ReferencePosition::CENTER;124125/// @brief set move shape126void setMoveShape(const GNEMoveResult& moveResult) override;127128/// @brief commit move shape129void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;130131/// @brief set size132void setSize(const std::string& value, GNEUndoList* undoList);133134/// @brief Invalidated copy constructor.135GNEMoveElementLaneDouble(const GNEMoveElementLaneDouble&) = delete;136137/// @brief Invalidated assignment operator138GNEMoveElementLaneDouble& operator=(const GNEMoveElementLaneDouble& src) = delete;139};140141142