Files
UnrealEngineUWP/Engine/Source/Editor/RewindDebuggerInterface/Public/RewindDebuggerTrack.h
Keith Yerex 58336fbf21 Add double click handler support for rewind debugger tracks, and add a double click handler for blend curve tracks
#rb Thomas.Sarkanen
#preflight 63054ba503520e063cd1a493

[CL 21522199 by Keith Yerex in ue5-main branch]
2022-08-23 18:05:58 -04:00

116 lines
2.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "IRewindDebuggerViewCreator.h"
namespace TraceServices
{
class IAnalysisSession;
}
namespace RewindDebugger
{
class FRewindDebuggerTrack
{
public:
FRewindDebuggerTrack(): bExpanded(true), bVisible(true)
{
}
virtual ~FRewindDebuggerTrack()
{
}
bool GetIsExpanded()
{
return bExpanded;
}
void SetIsExpanded(bool bIsExpanded)
{
bExpanded = bIsExpanded;
}
// Update should do work to compute children etc for the current time range. Return true if children have changed.
bool Update()
{
return UpdateInternal();
}
// Get a widget to show in the timeline view for this track
TSharedPtr<SWidget> GetTimelineView()
{
return GetTimelineViewInternal();
}
// Get a widget to show in the details tab, when this track is selected
TSharedPtr<SWidget> GetDetailsView()
{
return GetDetailsViewInternal();
}
// unique name for track (must match creator name if track is created by an IRewindDebuggerViewCreator)
FName GetName() const
{
return GetNameInternal();
}
// icon to display in the tree view
FSlateIcon GetIcon()
{
return GetIconInternal();
}
// display name for track in Tree View
FText GetDisplayName() const
{
return GetDisplayNameInternal();
}
// insights object id for an object associated with this track
uint64 GetObjectId() const
{
return GetObjectIdInternal();
}
// iterate over all sub-tracks of this track and call Iterator function
void IterateSubTracks(TFunction<void(TSharedPtr<FRewindDebuggerTrack> SubTrack)> IteratorFunction)
{
IterateSubTracksInternal(IteratorFunction);
}
// returns true for tracks that contain debug data (used for filtering out parts of the hierarchy with no useful information in them)
bool HasDebugData() const
{
return HasDebugDataInternal();
}
// Called when a track is double clicked. Returns true if the track handled the double click
bool HandleDoubleClick()
{
return HandleDoubleClickInternal();
}
bool IsVisible() const { return bVisible; }
void SetIsVisible(bool bInIsVisible) { bVisible = bInIsVisible; }
private:
virtual bool UpdateInternal() { return false; }
virtual TSharedPtr<SWidget> GetTimelineViewInternal() { return TSharedPtr<SWidget>(); }
virtual TSharedPtr<SWidget> GetDetailsViewInternal() { return TSharedPtr<SWidget>(); }
virtual FSlateIcon GetIconInternal() { return FSlateIcon(); }
virtual FName GetNameInternal() const { return ""; }
virtual FText GetDisplayNameInternal() const { return FText(); }
virtual uint64 GetObjectIdInternal() const { return 0; }
virtual bool HasDebugDataInternal() const { return true; }
virtual void IterateSubTracksInternal(TFunction<void(TSharedPtr<FRewindDebuggerTrack> SubTrack)> IteratorFunction) { }
virtual bool HandleDoubleClickInternal() { return false; }
bool bExpanded;
bool bVisible;
};
}