// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Input/Reply.h" #include "Widgets/DeclarativeSyntaxSupport.h" #include "Widgets/Views/STableViewBase.h" #include "Widgets/Views/STableRow.h" #include "Widgets/Views/STreeView.h" #include "Fbx/SSceneImportNodeTreeView.h" #include "Fbx/SSceneBaseMeshListView.h" struct FTreeNodeValue { public: FbxNodeInfoPtr CurrentNode; FbxNodeInfoPtr OriginalNode; }; class SFbxReimportSceneTreeView: public STreeView { public: ~SFbxReimportSceneTreeView(); SLATE_BEGIN_ARGS(SFbxReimportSceneTreeView) : _SceneInfo(nullptr), _SceneInfoOriginal(nullptr), _NodeStatusMap(nullptr) {} SLATE_ARGUMENT(TSharedPtr, SceneInfo) SLATE_ARGUMENT(TSharedPtr, SceneInfoOriginal) SLATE_ARGUMENT(FbxSceneReimportStatusMapPtr, NodeStatusMap) SLATE_END_ARGS() /** Construct this widget */ void Construct(const FArguments& InArgs); TSharedRef OnGenerateRowFbxSceneTreeView(FbxNodeInfoPtr Item, const TSharedRef& OwnerTable); void OnGetChildrenFbxSceneTreeView(FbxNodeInfoPtr InParent, TArray& OutChildren); void OnToggleSelectAll(ECheckBoxState CheckType); FReply OnExpandAll(); FReply OnCollapseAll(); static void FillNodeStatusMap(FbxSceneReimportStatusMapPtr NodeStatusMap, TSharedPtr SceneInfo, TSharedPtr SceneInfoOriginal); protected: TSharedPtr SceneInfo; TSharedPtr SceneInfoOriginal; FbxSceneReimportStatusMapPtr NodeStatusMap; /** the elements we show in the tree view */ TArray FbxRootNodeArray; /** Open a context menu for the current selection */ TSharedPtr OnOpenContextMenu(); void AddSelectionToImport(); void RemoveSelectionFromImport(); void SetSelectionImportState(bool MarkForImport); void OnSelectionChanged(FbxNodeInfoPtr Item, ESelectInfo::Type SelectionType); void GotoAsset(TSharedPtr AssetAttribute); void RecursiveSetImport(FbxNodeInfoPtr NodeInfoPtr, bool ImportStatus); // Internal structure and function to create the tree view status data TMap> NodeTreeData; static void FillNodeStatusMapInternal(FbxSceneReimportStatusMapPtr NodeStatusMap, TSharedPtr SceneInfo, TSharedPtr SceneInfoOriginal, TMap>* NodeTreeDataPtr, TArray* FbxRootNodeArrayPtr); };