SkeletonModelJointWidget.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 <AzQtComponents/Components/Widgets/Card.h>
  12. #include <EMotionFX/Source/ActorInstance.h>
  13. #include <QItemSelection>
  14. #include <QVBoxLayout>
  15. #include <QWidget>
  16. #endif
  17. QT_FORWARD_DECLARE_CLASS(QLabel)
  18. namespace EMotionFX
  19. {
  20. class Actor;
  21. class ActorInstance;
  22. class Node;
  23. class ColliderContainerWidget;
  24. class SkeletonModelJointWidget : public QWidget
  25. {
  26. Q_OBJECT // AUTOMOC
  27. public : SkeletonModelJointWidget(QWidget* parent = nullptr);
  28. ~SkeletonModelJointWidget() = default;
  29. virtual void CreateGUI();
  30. void Reinit();
  31. void showEvent(QShowEvent* event) override;
  32. void SetFilterString(QString filterString);
  33. virtual QString GetCardTitle() const = 0;
  34. virtual QColor GetColor() const = 0;
  35. void ErrorNotification(QString title, QString description);
  36. protected:
  37. Actor* GetActor() const;
  38. ActorInstance* GetActorInstance();
  39. Node* GetNode() const;
  40. QModelIndexList GetSelectedModelIndices() const;
  41. virtual QWidget* CreateContentWidget(QWidget* parent) = 0;
  42. virtual void InternalReinit() = 0;
  43. virtual int WidgetCount() const = 0;
  44. signals:
  45. void WidgetCountChanged();
  46. public slots:
  47. void OnSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
  48. void OnDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles);
  49. void OnModelReset();
  50. protected:
  51. QWidget* m_content = nullptr;
  52. AzQtComponents::Card* m_contentCard = nullptr;
  53. ColliderContainerWidget* m_collidersWidget = nullptr;
  54. QLabel* m_jointNameLabel;
  55. static int s_jointLabelSpacing;
  56. static int s_jointNameSpacing;
  57. };
  58. } // namespace EMotionFX