/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #pragma once #include #include #include #include #include #include #include #include QT_FORWARD_DECLARE_CLASS(QLabel) namespace EMotionFX { class SkeletonOutlinerPlugin : public EMStudio::DockWidgetPlugin , private EMotionFX::SkeletonOutlinerRequestBus::Handler { Q_OBJECT //AUTOMOC public: enum { CLASS_ID = 0x00754155 }; SkeletonOutlinerPlugin(); ~SkeletonOutlinerPlugin() override; // EMStudioPlugin overrides const char* GetName() const override { return "Skeleton Outliner"; } uint32 GetClassID() const override { return CLASS_ID; } bool GetIsClosable() const override { return true; } bool GetIsFloatable() const override { return true; } bool GetIsVertical() const override { return false; } EMStudioPlugin* Clone() override { return new SkeletonOutlinerPlugin(); } bool Init() override; // SkeletalOutlinerRequestBus overrides Node* GetSingleSelectedNode() override; QModelIndex GetSingleSelectedModelIndex() override; AZ::Outcome GetSelectedRowIndices() override; SkeletonModel* GetModel() override; void DataChanged(const QModelIndex& modelIndex) override; void DataListChanged(const QModelIndexList& modelIndexList) override; private slots: void OnSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); void OnTextFilterChanged(const QString& text); void OnTypeFilterChanged(const AzQtComponents::SearchTypeFilterList& activeTypeFilters); void Reinit(); void OnContextMenu(const QPoint& position); private: QWidget* m_mainWidget; QLabel* m_noSelectionLabel; AzQtComponents::FilteredSearchWidget* m_searchWidget; QTreeView* m_treeView; AZStd::unique_ptr m_skeletonModel; QModelIndexList m_selectedRows; SkeletonSortFilterProxyModel* m_filterProxyModel; static int s_iconSize; // Callbacks // Works for all commands that use the actor id as well as the joint name mixins MCORE_DEFINECOMMANDCALLBACK(DataChangedCallback); static bool DataChanged(AZ::u32 actorId, const AZStd::string& jointName); AZStd::vector m_commandCallbacks; }; } // namespace EMotionFX