Files
UnrealEngineUWP/Engine/Source/Editor/RewindDebuggerInterface/Public/IRewindDebugger.h
roland munguia f30e2a5b41 Adds ability to watch properties in Rewind Debugger. (Property Watch Track)
**New**
- Added `FPropertiesTrack` as the root track that handles the watched properties via Rewind Debugger.
- Added `FPropertyTrack` used to for watched property tracks via Rewind Debugger.
- Added `FPropertyWatchManager` used to keep track of watched traced properties.
- Added `FPropertyTracks` type specializations:`FBoolPropertyTrack` and `FNumericPropertyTrack`.
- Added `ReadObjectPropertiesStorage` method in `IGameplayProvider`. Used to access container where traced object properties are stored.
- Added `FindPropertyValueFromStorageIndex` method in `IGameplayProvider`. Used to access a traced property given its id.
- Added context menu building support via `FPropertyTrack` and `SPropertiesDebugViewBase`.
- Added a delegate for mouse button down on an `SVariantValueView`.
- Added `SPropertyTrackView` to show a single `FPropertyTrack` variable information in the Rewind Debugger details panel.
- Improved traced property variables displaying. Friendly display names. Specialization for bools, vector, vector2d and quaternions.
- Added a log category for Rewind Debugger. `LogRewindDebugger`.

**Changed**
- Updated `FObjectPropertyValue` to keep track of its unique name id, and unique parent id.
- Updated `FRewindDebugger` to handle menu registration for `ComponentContextMenu`.
- Updated `FVariantTreeNode` to support storing a trace property id. Used for details context menu to support having a menu entry to watch property.
- Updated `SPropertiesDebugViewBase` to have the ability to create a context menu.
- Updated `SObjectPropertiesView` to better display traced properties.
- Updated object property tracing to handle updated `FObjectPropertyValue`. Create unique named ids for properties.
- Updated `FGameAnalyzer` to handle new version of `FObjectPropertyValue`.
- Updated `FRewindDebuggerTrack` to support a building context menu.
- Updated `UComponentContextMenuContext` to stored the current Rewind Debugger selected track.

**Removed**
- Removed usage of `FObjectPropertiesViewCreator`. Now using `FPropertiesTrackCreator`.

#jira UE-159126
#preflight 634f0394dd0d2ceafae78188

[CL 22610498 by roland munguia in ue5-main branch]
2022-10-18 16:44:57 -04:00

105 lines
2.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "TraceServices/Model/Frames.h"
#include "IRewindDebugger.generated.h"
// IRewindDebugger
//
// Public interface to rewind debugger
REWINDDEBUGGERINTERFACE_API DECLARE_LOG_CATEGORY_EXTERN(LogRewindDebugger, Log, All);
namespace TraceServices
{
class IAnalysisSession;
}
struct FDebugObjectInfo
{
FDebugObjectInfo(uint64 Id, const FString& Name): ObjectId(Id), ObjectName(Name), bExpanded(true)
{
}
uint64 ObjectId;
FString ObjectName;
bool bExpanded;
TArray<TSharedPtr<FDebugObjectInfo>> Children;
};
namespace RewindDebugger
{
class FRewindDebuggerTrack;
class FPropertiesTrack;
}
UCLASS()
class REWINDDEBUGGERINTERFACE_API UComponentContextMenuContext : public UObject
{
GENERATED_BODY()
public:
TSharedPtr<FDebugObjectInfo> SelectedObject;
TArray<FName> TypeHierarchy;
TSharedPtr<RewindDebugger::FRewindDebuggerTrack> SelectedTrack;
};
class SPropertiesDebugViewBase;
class REWINDDEBUGGERINTERFACE_API IRewindDebugger
{
public:
IRewindDebugger();
virtual ~IRewindDebugger();
// get the time the debugger is scrubbed to, in seconds since the capture started (or the recording duration while the game is running)
virtual double CurrentTraceTime() const = 0;
// current visible range in trace/profiler units (same units as CurrentTraceTime)
virtual const TRange<double>& GetCurrentTraceRange() const = 0;
// current visible range in Rewind Debugger recording time units
virtual const TRange<double>& GetCurrentViewRange() const = 0;
// get the current analysis session
virtual const TraceServices::IAnalysisSession* GetAnalysisSession() const = 0;
// get insights id for the selected target actor
virtual uint64 GetTargetActorId() const = 0;
// get a list of all components of the selected target actor (with the actor as the first element in the list)
virtual TArray<TSharedPtr<FDebugObjectInfo>>& GetDebugComponents() = 0;
// returns the currently selected debug component
virtual TSharedPtr<FDebugObjectInfo> GetSelectedComponent() const = 0;
// returns the currently selected track
virtual TSharedPtr<RewindDebugger::FRewindDebuggerTrack> GetSelectedTrack() const = 0;
// get posiotion of the selected target actor (returns true if position is valid)
virtual bool GetTargetActorPosition(FVector& OutPosition) const = 0;
// get the world that the debugger is replaying in
virtual UWorld* GetWorldToVisualize() const = 0;
// returns true if recording is active
virtual bool IsRecording() const = 0;
// returns true if PIE is running and not paused
virtual bool IsPIESimulating() const = 0;
// returns the length of the current recording
virtual double GetRecordingDuration() const = 0;
// opens the Rewind Debugger details panel tab
virtual void OpenDetailsPanel() = 0;
// get the current IRewindDebugger instance
static IRewindDebugger* Instance();
protected:
static IRewindDebugger* InternalInstance;
};