// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "MuR/Instance.h" #include "MuR/System.h" #include "UObject/GCObject.h" #include "Widgets/SCompoundWidget.h" template class SListView; class ITableRow; class SBorder; class SMutableMeshViewport; class SScrollBox; class SSplitter; class STableViewBase; class SWidget; /** */ struct FMutableInstanceViewerSurfaceElement { FText Id; FText SharedId; FText CustomId; FText ImageCount; FText VectorCount; FText ScalarCount; FText StringCount; }; /** */ struct FMutableInstanceViewerLODElement { FText LODIndex; FText MeshId; TSharedPtr>> Surfaces; }; /** */ struct FMutableInstanceViewerComponentElement { FText ComponentIndex; TSharedPtr>> LODs; }; /** Widget designed to show the statistical data from a Mutable Instance*/ class SMutableInstanceViewer : public SCompoundWidget { public: SLATE_BEGIN_ARGS(SMutableInstanceViewer) {} SLATE_END_ARGS() /** Builds the widget */ void Construct(const FArguments& InArgs); /** Set the Mutable Instance to be used for this widget */ void SetInstance(const TSharedPtr&, const TSharedPtr&, const TSharedPtr&, const mu::FSystem&); /** */ TSharedRef GenerateLODsListView(const TSharedPtr>>& InBufferChannelElements); TSharedRef GenerateSurfaceListView(const TSharedPtr>>& InBufferChannelElements); private: /** Data backend for the widget. It represents the Instance that is being "displayed" */ TSharedPtr MutableInstance = nullptr; /** Splitter used to separate the two sides of the slate (tables and viewport) */ TSharedPtr SpaceSplitter; /** Slate object containing all the buffer tables alongside with the bone tree */ TSharedPtr DataSpaceSlate; /** Viewport object to preview the current Instance inside an actual Unreal scene */ TSharedPtr InstanceViewport; /** */ TSharedPtr>> ComponentsSlateView; private: /** Generates all slate objects related with the Instance Viewport Slate */ TSharedRef GenerateViewportSlates(); /** Generates the tables showing the buffer data on the Instance alongside with the bone tree found on the mutable Instance */ TSharedRef GenerateDataTableSlates(); private: /** */ FText GetInstanceID() const; /** */ TArray> Components; /** */ TSharedRef GenerateComponentsListView(); /** */ TSharedRef OnGenerateComponentRow(TSharedPtr, const TSharedRef& OwnerTable); TSharedRef OnGenerateLODRow(TSharedPtr, const TSharedRef& OwnerTable); TSharedRef OnGenerateSurfaceRow(TSharedPtr, const TSharedRef& OwnerTable); };