diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp deleted file mode 100644 index 72719a1bf3..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#if 0 - -#include "EntityTransformCommand.h" -#include -#include -#include - -namespace AzToolsFramework -{ - TransformCommand::TransformCommand(const AZ::u64& contextId, const AZStd::string& friendlyName, const EntityList& captureEntities) - : UndoSystem::URSequencePoint(friendlyName) - , m_contextId(contextId) - { - for (auto it = captureEntities.begin(); it != captureEntities.end(); ++it) - { - SRT current; - EBUS_EVENT_ID_RESULT(current, *it, TransformComponentMessages::Bus, GetLocalSRT); - m_priorTransforms[*it] = current; - m_nextTransforms[*it] = current; - } - - m_undoCacheInterface = AZ::Interface::Get(); - AZ_Assert(m_undoCacheInterface, "Could not get UndoCacheInterface on TransformCommand construction."); - } - - void TransformCommand::Post() - { - // add to undo stack - UndoSystem::UndoStack* undoStack = NULL; - EBUS_EVENT_ID_RESULT(undoStack, m_contextId, SelectionMessages::Bus, GetUndoStack); - - if (undoStack) - { - undoStack->Post(this); - } - - for (auto it = m_priorTransforms.begin(); it != m_priorTransforms.end(); ++it) - { - m_undoCacheInterface->UpdateCache(it->first); - } - } - - void TransformCommand::Undo() - { - for (auto it = m_priorTransforms.begin(); it != m_priorTransforms.end(); ++it) - { - EBUS_EVENT_ID(it->first, TransformComponentMessages::Bus, SetLocalSRT, it->second); - m_undoCacheInterface->UpdateCache(it->first); - } - } - - void TransformCommand::Redo() - { - for (auto it = m_nextTransforms.begin(); it != m_nextTransforms.end(); ++it) - { - EBUS_EVENT_ID(it->first, TransformComponentMessages::Bus, SetLocalSRT, it->second); - m_undoCacheInterface->UpdateCache(it->first); - } - } - - void TransformCommand::CaptureNewTransform(const AZ::EntityId entityId) - { - AZ_Assert(m_priorTransforms.find(entityId) != m_priorTransforms.end(), "You can't add new transforms during an operation"); - AZ_Assert(m_nextTransforms.find(entityId) != m_nextTransforms.end(), "You can't add new transforms during an operation"); - - SRT current; - EBUS_EVENT_ID_RESULT(current, entityId, TransformComponentMessages::Bus, GetLocalSRT); - m_nextTransforms[entityId] = current; - } - - void TransformCommand::RevertToPriorTransform(const AZ::EntityId entityId) - { - AZ_Assert(m_priorTransforms.find(entityId) != m_priorTransforms.end(), "No such entity!"); - - m_nextTransforms[entityId] = m_priorTransforms[entityId]; - EBUS_EVENT_ID(entityId, TransformComponentMessages::Bus, SetLocalSRT, m_priorTransforms[entityId]); - } -} - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h deleted file mode 100644 index 7448b2cac5..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef TRANSFORM_COMMAND_H -#define TRANSFORM_COMMAND_H - -#if 0 - -#include -#include -#include -#include -#include -#include - -#pragma once - -namespace AzToolsFramework -{ - namespace UndoSystem - { - class UndoCacheInterface; - } - - typedef AZStd::vector EntityList; - - // transform command specializes undo to just care about the transform of an entity instead of the entire thing, for performance. - class TransformCommand - : public UndoSystem::URSequencePoint - { - public: - AZ_CLASS_ALLOCATOR(TransformCommand, AZ::SystemAllocator, 0); - AZ_RTTI(TransformCommand); - - TransformCommand(const AZ::u64& contextId, const AZStd::string& friendlyName, const EditorFramework::EntityList& captureEntities); - virtual ~TransformCommand() {} - - // the default will work for selections with out an undo stack(maybe move the undo stack here too - void CaptureNewTransform(const AZ::EntityId entityId); - void RevertToPriorTransform(const AZ::EntityId entityID); - - virtual void Undo(); - virtual void Redo(); - - virtual void Post(); - - protected: - AZ::u64 m_contextId; - - typedef AZStd::unordered_map CapturedTransforms; - - CapturedTransforms m_priorTransforms; - CapturedTransforms m_nextTransforms; - - private: - UndoCacheInterface* m_undoCacheInterface; - }; -} - -#endif // disabled - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index e0ab8d5b73..dc2ceabfcc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -483,8 +483,6 @@ set(FILES Commands/EntityStateCommand.h Commands/SelectionCommand.cpp Commands/SelectionCommand.h - Commands/EntityTransformCommand.cpp - Commands/EntityTransformCommand.h Commands/PreemptiveUndoCache.cpp Commands/PreemptiveUndoCache.h Commands/BaseSliceCommand.cpp