You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Buffered curves now can only operate on themselves, matching by LongDisplayName. The operations are also restricted to the selected curves (either selected in the tree or selected by way of selected keys). There is a new option to Swap Buffered Curves which stores the current curve to the buffer and restores the buffer to the current curve. The Store/Swap/Apply menus are now visible for all the context menus (keys, hovered curve, all curves). There is also a new toggle to show/hide buffered curves and they are also only visible when the curve is selected. #jira UE-143895 #preflight 62294f800d5a90e98ed4ae68 #rb mike.zyracki #ROBOMERGE-AUTHOR: max.chen #ROBOMERGE-SOURCE: CL 19344793 via CL 19346614 via CL 19351363 via CL 19351424 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884) [CL 19351984 by max chen in ue5-main branch]
62 lines
2.2 KiB
C++
62 lines
2.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
#pragma once
|
|
|
|
#include "Containers/Array.h"
|
|
#include "Templates/Tuple.h"
|
|
#include "CurveDataAbstraction.h"
|
|
|
|
struct FCurveEditorScreenSpace;
|
|
|
|
class FCurveEditor;
|
|
class FCurveModel;
|
|
|
|
/**
|
|
* Represents a buffered curve which can be applied to a standard curve model
|
|
*/
|
|
class IBufferedCurveModel
|
|
{
|
|
public:
|
|
IBufferedCurveModel(TArray<FKeyPosition>&& InKeyPositions, TArray<FKeyAttributes>&& InKeyAttributes, const FString& InLongDisplayName, const double InValueMin, const double InValueMax)
|
|
: KeyPositions(MoveTemp(InKeyPositions))
|
|
, KeyAttributes(MoveTemp(InKeyAttributes))
|
|
, LongDisplayName(InLongDisplayName)
|
|
, ValueMin(InValueMin)
|
|
, ValueMax(InValueMax)
|
|
{}
|
|
|
|
virtual ~IBufferedCurveModel() = default;
|
|
|
|
/** draws the curve into an array of (input, output) pairs with a given screen space */
|
|
virtual void DrawCurve(const FCurveEditor& CurveEditor, const FCurveEditorScreenSpace& ScreenSpace, TArray<TTuple<double, double>>& InterpolatingPoints) const = 0;
|
|
|
|
/**
|
|
* Retrieve all key positions stored in this buffered curve
|
|
*
|
|
* @param OutKeyPositions Array to receive key positions, one per index of InKeys
|
|
*/
|
|
FORCEINLINE void GetKeyPositions(TArray<FKeyPosition>& OutKeyPositions) const { OutKeyPositions = KeyPositions; }
|
|
|
|
/**
|
|
* Retrieve all key attributes stored in this buffered curve
|
|
*
|
|
* @param OutAttributes Array to receive key attributes, one per index of InKeys
|
|
*/
|
|
FORCEINLINE void GetKeyAttributes(TArray<FKeyAttributes>& OutKeyAttributes) const { OutKeyAttributes = KeyAttributes; }
|
|
|
|
/**
|
|
* Returns the full/long display name of the curves. Buffered curves can only be applied to the original curve it was stored from.
|
|
*/
|
|
FORCEINLINE FString GetLongDisplayName() const { return LongDisplayName; }
|
|
|
|
/** returns the lowest output value in curve space for this buffered curve */
|
|
FORCEINLINE double GetValueMin() const { return ValueMin; }
|
|
|
|
/** returns the highest output value in curve space for this buffered curve */
|
|
FORCEINLINE double GetValueMax() const { return ValueMax; }
|
|
|
|
protected:
|
|
TArray<FKeyPosition> KeyPositions;
|
|
TArray<FKeyAttributes> KeyAttributes;
|
|
FString LongDisplayName;
|
|
double ValueMin, ValueMax;
|
|
}; |