ObjectEditor.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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/RTTI/TypeInfo.h>
  11. #include <QFrame>
  12. #include <QWidget>
  13. #endif
  14. // Forward declarations
  15. namespace AZ { class SerializeContext; }
  16. namespace AzToolsFramework
  17. {
  18. class ReflectedPropertyEditor;
  19. class IPropertyEditorNotify;
  20. } // namespace AzToolsFramework
  21. namespace EMotionFX
  22. {
  23. class ObjectEditor
  24. : public QFrame
  25. {
  26. Q_OBJECT // AUTOMOC
  27. public:
  28. explicit ObjectEditor(AZ::SerializeContext* serializeContext, QWidget* parent = nullptr);
  29. ObjectEditor(AZ::SerializeContext* serializeContext, AzToolsFramework::IPropertyEditorNotify* notify, QWidget* parent = nullptr);
  30. void AddInstance(void* object, const AZ::TypeId& objectTypeId, void* aggregateInstance = nullptr, void* compareInstance = nullptr);
  31. void ClearInstances(bool invalidateImmediately);
  32. //! Filter Reflected Properties
  33. void SetFilterString(QString filterString);
  34. //! Returns true if any Node in the Reflected Property Editor is displayed
  35. bool HasDisplayedNodes() const;
  36. void* GetObject() { return m_object; }
  37. public slots:
  38. void InvalidateAll();
  39. void InvalidateValues();
  40. private:
  41. void* m_object;
  42. AzToolsFramework::ReflectedPropertyEditor* m_propertyEditor;
  43. static const int s_propertyLabelWidth;
  44. };
  45. } // namespace EMotionFX