SCurveEditorView

This is the base widget type for all views that exist on a curve editor panel.

Unreal Engine C++ API Reference > Editor > CurveEditor

Inheritance Hierarchy

References

   
Module CurveEditor
Header /Engine/Source/Editor/CurveEditor/Public/SCurveEditorView.h
Include #include "SCurveEditorView.h"

Syntax

class SCurveEditorView : public [SCompoundWidget](API\Runtime\SlateCore\Widgets\SCompoundWidget)  

Remarks

This is the base widget type for all views that exist on a curve editor panel. A view may contain 0 or more curves (stored in CurveInfoByID). SCurveEditorViews are directly housed within a single SCurveEditorViewContainer which arranges each view vertically in order.

View types: A view may have a centrally registered ID (See FCurveEditorViewRegistry and FCurveModel::GetSupportedViews) which allows any external curve model type to express support for any other view type. 3 built-in views are provided: Absolute: Shows 1 or more curves on a single 2D-scrollable grid using a single zoomable view-space. Normalized: Shows 1 or more curves on a single grid scrollable horizontally with all curves normalized to the extents of the view Stacked: Shows 1 or more curves on separate fixed-height grids scrollable horizontally each curve normalized to the extents of its own grid Unregistered curve views may still be added to the view by calling SCurveEditorPanel::AddView

Space Transformations: Views must define a valid 2-dimensional space (ViewSpace) that is used to convert from a pixel position to the virtual view space. Views may additionally implement per-curve transformations from view space to curve space, to allow for specific layouts/scales of curves within them. Per-curve transforms are stored inside FCurveInfo::ViewToCurveTransform

Sizing: Views may be size in one of 2 ways:

  • Auto sized (bAutoSize=true): views derive their height from the widget's desired size;
  • Stretched (bAutoSize=false): views will be stretched to the size of the parent panel with a sensible minimum height.

Variables

Type Name Description
uint8: 1 bAllowEmpty (Default: false) Defines whether this view should remain on the panel UI even if it does not represent any curves.
uint8: 1 bAutoSize (Default: true) See class notes - defines whether this view should size to its desired size (true) or stretch to the height of the panel (false).
uint8: 1 bFixedOutputBounds (Default: false) When true, this view has fixed vertical bounds that should never be changed by zooming or panning
uint8: 1 bInteractive (Default: true) When true, this view should accept interactive operations such as drags and tool interaction
uint8: 1 bPinned (Default: false) When true, this view has been pinned to the top of the view container.
TArray< FCurveD... CachedDrawParams Curve draw parameters that are re-generated on tick if the cache has changed.
FCachedValuesTo... CachedValues  
ECurveCacheFlag... CurveCacheFlags Curve cache flags that change based upon data or view getting modified
TSortedMap< FCu... CurveInfoByID Map from curve identifier to specific info pertaining to that curve for this view.
TAttribute< flo... FixedHeight (Optional) Attribute that defines a fixed height for this view.
int32 MaximumCapacity The maximum number of curves allowed on this view, or 0 for no limit
double OutputMax This view's maximum visible output value
double OutputMin This view's minimum visible output value
int32 RelativeOrder Transient integer that is assigned each time the view container order is changed, to guarantee relative ordering of views when the list changes
TSharedPtr< SRe... RetainerWidget Possible pointer to a retainer widget that we may need to force update
int8 SortBias (Default: 0) Should be assigned on Construction of derived types.
ECurveEditorVie... ViewTypeID This view's type identifier. Assigned by the curve editor panel after construction.
TWeakPtr< FCurv... WeakCurveEditor The curve editor associated with this view.

Constructors

Type Name Description
  SCurveEditorView () Default constructor

Functions

Type Name Description
void BindCommands () Bind UI commands for this view
void CheckCacheAndInvalidateIfNeeded () This should be called every tick by an owning widget, to see if the cache is valid, which will then recreate it and invalidate widget
void FrameVertical ( double InOutputMin, double InOutputMax ) Frame the view vertially by the input and output bounds, peformaing any custom clipping as needed
void GetCurveDrawParam ( TSharedPtr< FCurveEditor >& CurveE..., const FCurveModelID& ModelID, FCurveModel* CurveModel, double InputMin, double InputMax, FCurveDrawParams& OutDrawParam ) Get it for just one curve
void GetCurveDrawParams ( TArray< FCurveDrawParams >& OutDra... ) Gets info about the curves being drawn.
FCurveEditor... GetCurveSpace ( FCurveModelID CurveID ) Get the screen space ultility that defines the specified curves's input, output and pixel metrics.
bool GetCurveWithinWidgetRange ( const FSlateRect& WidgetRectangle, TArray< FCurvePointHandle >* O... ) Retrieve all the curve points, if any of the interpolating points overlap the specified rectangle in widget space
void GetGridLinesX ( TSharedRef< const FCurveEditor > Cu..., TArray< float >& MajorGridLines, TArray< float >& MinorGridLines, TArray< FText >* MajorGridLabe... )  
void GetGridLinesY ( TSharedRef< const FCurveEditor > Cu..., TArray< float >& MajorGridLines, TArray< float >& MinorGridLines, TArray< FText >* MajorGridLabe... )  
TOptional< F... GetHoveredCurve () Retrieve the id of the hovered curve
void GetInputBounds ( double& OutInputMin, double& OutInputMax ) Retrieve this view's input bounds, accounting for any offsets or padding from the outer container
double GetOutputMax () Retrieve this view's maximum output bound in view space
double GetOutputMin () Retrieve this view's minimum output bound in view space
bool GetPointsWithinWidgetRange ( const FSlateRect& WidgetRectangle, TArray< FCurvePointHandle >* O... ) Retrieve all the curve points that overlap the specified rectangle in widget space
FCurveEditor... GetViewSpace () Get the screen space ultility that defines this view's input, output and pixel metrics
bool HasCapacity () Check whether this view has space for any more curves
bool IsInteractive () Check whether this view can be interacted with.
bool IsTimeSnapEnabled () Should the tools respect the global snapping rules for Time (X axis) input when manipulating a curve in this view.
bool IsValueSnapEnabled () Should the tools respect the global snapping rules for Value (Y axis) input when manipulating a curve in this view.
int32 NumCurves () Retrieve the number of curves that exist on this view
void OnCurveListChanged () Invoked when a curve has been added or removed from this list.
void RefreshRetainer () Request a new render from the retainer widget
void SetOutputBounds ( double InOutputMin, double InOutputMax ) Set this view's output bounds
void SetRetainerWidget ( TSharedPtr< SRetainerWidget >& InW... )  
bool ShouldAutoSize () Check whether this view should auto size to fit its FixedHeight or child slot content
void UpdateViewToTransformCurves ( double InputMin, double InputMax ) Function to make sure to update the view to the transform curves, we need to do this before we cache
void Zoom ( const FVector2D& Amount ) Zoom this view in or out around its center point
void ZoomAround ( const FVector2D& Amount, double InputOrigin, double OutputOrigin ) Zoom this view in or out around the specified point

Overridden from SWidget

Type Name Description
FVector2D ComputeDesiredSize ( float LayoutScaleMultiplier ) Compute the ideal size necessary to display this widget.

Classes

Type Name Description
Protected struct FCachedValuesToCheck Set of Cached values we need to check each tick to see if we need to redo cache
Protected struct FCurveInfo  

Enums

Type Name Description
Protected enum ECurveCacheFlags Flag enum signifying how the curve cache has changed since it was last generated Note for a data change it may only effect certain data(curves) not every drawn curve

Deprecated Functions


Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library