You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- also fixes memory leak #JIRA UETOOL-3357 #rb Lauren.Barnes #preflight 618c0571b253729fe22756ae [CL 18140736 by Louise Rasmussen in ue5-main branch]
62 lines
1.7 KiB
C
62 lines
1.7 KiB
C
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Curves/CurveOwnerInterface.h"
|
|
#include "UObject/WeakObjectPtr.h"
|
|
#include "Engine/CurveTable.h"
|
|
|
|
/**
|
|
* Handle to a particular row in a table, used for editing individual curves
|
|
*/
|
|
struct FCurveTableEditorHandle : public FCurveOwnerInterface
|
|
{
|
|
FCurveTableEditorHandle()
|
|
: CurveTable(nullptr)
|
|
, RowName(NAME_None)
|
|
{ }
|
|
|
|
FCurveTableEditorHandle(UCurveTable* InCurveTable, FName InRowName)
|
|
: CurveTable(InCurveTable)
|
|
, RowName(InRowName)
|
|
{ }
|
|
|
|
/** Pointer to table we want a row from */
|
|
TWeakObjectPtr<UCurveTable> CurveTable;
|
|
|
|
/** Name of row in the table that we want */
|
|
FName RowName;
|
|
|
|
//~ Begin FCurveOwnerInterface Interface.
|
|
virtual TArray<FRichCurveEditInfoConst> GetCurves() const override;
|
|
virtual TArray<FRichCurveEditInfo> GetCurves() override;
|
|
virtual void ModifyOwner() override;
|
|
virtual void MakeTransactional() override;
|
|
virtual void OnCurveChanged(const TArray<FRichCurveEditInfo>& ChangedCurveEditInfos) override;
|
|
virtual bool IsValidCurve(FRichCurveEditInfo CurveInfo) override;
|
|
virtual TArray<const UObject*> GetOwners() const override;
|
|
|
|
|
|
//~ End FCurveOwnerInterface Interface.
|
|
|
|
/** Returns true if the curve is valid */
|
|
bool IsValid() const
|
|
{
|
|
return (GetCurve() != nullptr);
|
|
}
|
|
|
|
/** Returns true if this handle is specifically pointing to nothing */
|
|
bool IsNull() const
|
|
{
|
|
return CurveTable == nullptr && RowName == NAME_None;
|
|
}
|
|
|
|
/** Get the curve straight from the row handle */
|
|
FRealCurve* GetCurve() const;
|
|
FRichCurve* GetRichCurve() const;
|
|
|
|
/** Returns true if the owning table uses RichCurves instead of Real Curves */
|
|
bool HasRichCurves() const;
|
|
};
|