Files
UnrealEngineUWP/Engine/Source/Editor/CurveTableEditor/Private/CurveTableEditorHandle.h
ryan durand 627baf970a Updating copyright for Engine Editor.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869241 via CL 10869527 via CL 10869904
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870586 by ryan durand in Main branch]
2019-12-26 15:33:43 -05:00

61 lines
1.6 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(const UCurveTable* InCurveTable, FName InRowName)
: CurveTable(InCurveTable)
, RowName(InRowName)
{ }
/** Pointer to table we want a row from */
TWeakObjectPtr<const 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
{
//Note this is read only so we return nothing
return TArray<const UObject*>();
}
//~ 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;
};