/* * 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 * */ #pragma once #if !defined(Q_MOC_RUN) #include #include #include #include #include #endif // forward declarations QT_FORWARD_DECLARE_CLASS(QLabel) QT_FORWARD_DECLARE_CLASS(QIcon) QT_FORWARD_DECLARE_CLASS(QTreeWidget) QT_FORWARD_DECLARE_CLASS(QTreeWidgetItem) namespace AzQtComponents { class FilteredSearchWidget; } namespace EMotionFX { class SimulatedObject; } namespace EMStudio { class SimulatedObjectSelectionWidget : public QWidget { Q_OBJECT // AUTOMOC MCORE_MEMORYOBJECTCATEGORY(SimulatedObjectSelectionWidget, MCore::MCORE_DEFAULT_ALIGNMENT, MEMCATEGORY_STANDARDPLUGINS_ANIMGRAPH) public: SimulatedObjectSelectionWidget(QWidget* parent); void Update(EMotionFX::Actor* actor, const AZStd::vector& selectedSimulatedObjectNames); QTreeWidget* GetTreeWidget() { return m_treeWidget; } AzQtComponents::FilteredSearchWidget* GetSearchWidget() { return m_searchWidget; } // This calls UpdateSelection() and then returns the member array containing the selected items AZStd::vector& GetSelectedSimulatedObjectNames(); signals: void OnSelectionDone(const AZStd::vector& selectedItems); void OnDoubleClicked(const AZStd::string& item); public slots: void Update(); void UpdateSelection(); void ItemDoubleClicked(QTreeWidgetItem* item, int column); void OnTextFilterChanged(const QString& text); private: void AddSimulatedObjectToInterface(const EMotionFX::SimulatedObject* object); EMotionFX::Actor* m_actor = nullptr; QTreeWidget* m_treeWidget = nullptr; AzQtComponents::FilteredSearchWidget* m_searchWidget = nullptr; AZStd::string m_searchWidgetText; AZStd::vector m_selectedSimulatedObjectNames; AZStd::vector m_oldSelectedSimulatedObjectNames; }; } // namespace EMStudio