/****************************************************************************/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.cpp14/// @author Jakob Erdmann15/// @date Mar 201116///17// The reification of a netedit editing operation (see command pattern)18// inherits from FXCommand and is used to for undo/redo19/****************************************************************************/2021#include "GNEChange.h"2223// ===========================================================================24// FOX-declarations25// ===========================================================================2627FXIMPLEMENT_ABSTRACT(GNEChange, FXObject, nullptr, 0)2829// ===========================================================================30// member method definitions31// ===========================================================================3233GNEChange::GNEChange(Supermode supermode, bool forward, const bool selectedElement) :34mySupermode(supermode),35myForward(forward),36mySelectedElement(selectedElement),37next(nullptr) {38}394041GNEChange::GNEChange(Supermode supermode, GNEHierarchicalElement* hierarchicalElement, bool forward, const bool selectedElement) :42mySupermode(supermode),43myParents(hierarchicalElement->getParents()),44myForward(forward),45mySelectedElement(selectedElement),46next(nullptr) {47// if we're creating the element, clear hierarchical elements (because parent and children will be added in undo-redo)48if (forward) {49hierarchicalElement->clearParents();50}51}525354GNEChange::~GNEChange() {}555657int58GNEChange::size() const {59// by default, 160return 1;61}626364Supermode65GNEChange::getSupermode() const {66return mySupermode;67}686970bool71GNEChange::canMerge() const {72return false;73}747576bool77GNEChange::mergeWith(GNEChange*) {78return false;79}808182GNEChange::GNEChange() :83mySupermode(Supermode::NETWORK),84myForward(false),85mySelectedElement(false),86next(nullptr) {87}8889/****************************************************************************/909192