TransformRowHandler.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #if !defined(Q_MOC_RUN)
  10. #include <AzCore/Math/Transform.h>
  11. #include <AzCore/Memory/SystemAllocator.h>
  12. #include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h>
  13. #include <SceneAPI/SceneUI/RowWidgets/TransformRowWidget.h>
  14. #endif
  15. class QWidget;
  16. namespace AZ
  17. {
  18. namespace SceneAPI
  19. {
  20. namespace SceneUI
  21. {
  22. class TranformRowHandler
  23. : public QObject
  24. , public AzToolsFramework::PropertyHandler<AZ::Transform, TransformRowWidget>
  25. {
  26. Q_OBJECT
  27. public:
  28. AZ_CLASS_ALLOCATOR_DECL
  29. QWidget* CreateGUI(QWidget* parent) override;
  30. u32 GetHandlerName() const override;
  31. bool AutoDelete() const override;
  32. bool IsDefaultHandler() const override;
  33. void ConsumeAttribute(TransformRowWidget* widget, u32 attrib,
  34. AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override;
  35. void WriteGUIValuesIntoProperty(size_t index, TransformRowWidget* GUI, property_t& instance,
  36. AzToolsFramework::InstanceDataNode* node) override;
  37. bool ReadValuesIntoGUI(size_t index, TransformRowWidget* GUI, const property_t& instance,
  38. AzToolsFramework::InstanceDataNode* node) override;
  39. static void Register();
  40. static void Unregister();
  41. protected:
  42. virtual void ConsumeFilterTypeAttribute(TransformRowWidget* widget,
  43. AzToolsFramework::PropertyAttributeReader* attrValue);
  44. private:
  45. static TranformRowHandler* s_instance;
  46. };
  47. } // namespace SceneUI
  48. } // namespace SceneAPI
  49. } // namespace AZ