/* * 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 // 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