Search Results for

    Show / Hide Table of Contents

    Class CurveEditor<T>

    The generic curve editor control.

    Inheritance
    System.Object
    Control
    ContainerControl
    FlaxEditor.GUI.CurveEditorBase
    CurveEditor<T>
    BezierCurveEditor<T>
    LinearCurveEditor<T>
    Implements
    System.IComparable
    IDrawable
    Inherited Members
    ContainerControl._children
    ContainerControl._containsFocus
    ContainerControl._isLayoutLocked
    ContainerControl.LockChildrenRecursive()
    ContainerControl.UnlockChildrenRecursive()
    ContainerControl.RemoveChildren()
    ContainerControl.DisposeChildren()
    ContainerControl.AddChild<T>()
    ContainerControl.AddChild<T>(T)
    ContainerControl.RemoveChild(Control)
    ContainerControl.GetChild(Int32)
    ContainerControl.GetChild<T>()
    ContainerControl.GetChildIndex(Control)
    ContainerControl.GetChildIndexAt(Float2)
    ContainerControl.GetChildAt(Float2)
    ContainerControl.GetChildAt(Float2, Func<Control, Boolean>)
    ContainerControl.GetChildAtRecursive(Float2)
    ContainerControl.GetClientArea()
    ContainerControl.SortChildren()
    ContainerControl.SortChildrenRecursive()
    ContainerControl.OnChildResized(Control)
    ContainerControl.OnChildrenChanged()
    ContainerControl.GetDesireClientArea(Rectangle)
    ContainerControl.IntersectsChildContent(Control, Float2, Float2)
    ContainerControl.OnNavigate(NavDirection, Float2, Control, List<Control>)
    ContainerControl.CanNavigateChild(Control)
    ContainerControl.NavigationWrap(NavDirection, Float2, List<Control>, Float2)
    ContainerControl.UpdateContainsFocus()
    ContainerControl.UpdateChildrenBounds()
    ContainerControl.PerformLayoutBeforeChildren()
    ContainerControl.PerformLayoutAfterChildren()
    ContainerControl.Update(Single)
    ContainerControl.ClearState()
    ContainerControl.DrawSelf()
    ContainerControl.DrawChildren()
    ContainerControl.ContainsPoint(Float2, Boolean)
    ContainerControl.PerformLayout(Boolean)
    ContainerControl.RayCast(Float2, Control)
    ContainerControl.OnMouseEnter(Float2)
    ContainerControl.OnMouseMove(Float2)
    ContainerControl.OnMouseLeave()
    ContainerControl.OnMouseWheel(Float2, Single)
    ContainerControl.OnMouseDown(Float2, MouseButton)
    ContainerControl.OnMouseUp(Float2, MouseButton)
    ContainerControl.OnMouseDoubleClick(Float2, MouseButton)
    ContainerControl.IsTouchPointerOver(Int32)
    ContainerControl.OnTouchEnter(Float2, Int32)
    ContainerControl.OnTouchDown(Float2, Int32)
    ContainerControl.OnTouchMove(Float2, Int32)
    ContainerControl.OnTouchUp(Float2, Int32)
    ContainerControl.OnTouchLeave(Int32)
    ContainerControl.OnCharInput(Char)
    ContainerControl.OnKeyUp(KeyboardKeys)
    ContainerControl.OnDragEnter(Float2, DragData)
    ContainerControl.OnDragMove(Float2, DragData)
    ContainerControl.OnDragLeave()
    ContainerControl.OnDragDrop(Float2, DragData)
    ContainerControl.Children
    ContainerControl.ChildrenCount
    ContainerControl.HasChildren
    ContainerControl.ContainsFocus
    ContainerControl.ClipChildren
    ContainerControl.CullChildren
    ContainerControl.IsTouchOver
    Control.Resize(Float2)
    Control.UpdateBounds()
    Control.UpdateTransform()
    Control.SetAnchorPreset(AnchorPresets, Boolean, Boolean)
    Control.Dispose()
    Control.Focus()
    Control.Defocus()
    Control.OnGotFocus()
    Control.OnLostFocus()
    Control.OnStartContainsFocus()
    Control.OnEndContainsFocus()
    Control.Focus(Control)
    Control.StartMouseCapture(Boolean)
    Control.EndMouseCapture()
    Control.OnEndMouseCapture()
    Control.GetNavTarget(NavDirection)
    Control.GetNavOrigin(NavDirection)
    Control.NavigationFocus()
    Control.OnSubmit()
    Control.OnTouchLeave()
    Control.DoDragDrop(DragData)
    Control.LinkTooltip(String, Tooltip)
    Control.UnlinkTooltip()
    Control.OnShowTooltip(String, Float2, Rectangle)
    Control.OnTooltipShown(Tooltip)
    Control.OnTestTooltipOverControl(Float2)
    Control.IntersectsContent(Float2, Float2)
    Control.PointToParent(ContainerControl, Float2)
    Control.PointToParent(Float2)
    Control.PointToParent(Float2)
    Control.PointFromParent(Float2)
    Control.PointFromParent(Float2)
    Control.PointFromParent(ContainerControl, Float2)
    Control.PointToWindow(Float2)
    Control.PointFromWindow(Float2)
    Control.PointToScreen(Float2)
    Control.PointFromScreen(Float2)
    Control.OnLocationChanged()
    Control.SetScaleInternal(Float2)
    Control.SetPivotInternal(Float2)
    Control.SetShearInternal(Float2)
    Control.SetRotationInternal(Single)
    Control.OnVisibleChanged()
    Control.OnParentChangedInternal()
    Control.AddUpdateCallbacks(RootControl)
    Control.RemoveUpdateCallbacks(RootControl)
    Control.SetUpdate(Control.UpdateDelegate, Control.UpdateDelegate)
    Control.OnParentResized()
    Control.CompareTo(Object)
    Control.Compare(Control)
    Control.Top
    Control.Bottom
    Control.Left
    Control.Right
    Control.UpperLeft
    Control.UpperRight
    Control.BottomRight
    Control.BottomLeft
    Control.Scale
    Control.Pivot
    Control.Shear
    Control.Rotation
    Control.HasParent
    Control.BackgroundColor
    Control.BackgroundBrush
    Control.Enabled
    Control.EnabledInHierarchy
    Control.Visible
    Control.VisibleInHierarchy
    Control.IsDisposing
    Control.Root
    Control.RootWindow
    Control.DpiScale
    Control.ScreenPos
    Control.AutoFocus
    Control.IsFocused
    Control.IsNavFocused
    Control.IsMouseOver
    Control.IsDragOver
    Control.Tooltip
    Control.ShowTooltip
    Control.EditorBounds
    Control.LocationChanged
    Control.SizeChanged
    Control.ParentChanged
    Control.VisibleChanged
    Namespace: FlaxEditor.GUI
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    public abstract class CurveEditor<T> : CurveEditorBase, IComparable, IDrawable, IKeyframesEditor where T : new()
    Type Parameters
    T

    The keyframe value type.

    Constructors

    CurveEditor()

    Initializes a new instance of the CurveEditor<T> class.

    Declaration
    protected CurveEditor()

    Fields

    _contents

    The curve contents area.

    Declaration
    protected CurveEditor<T>.ContentsBase _contents
    Field Value
    CurveEditor.ContentsBase<>

    _mainPanel

    The main UI panel with scroll bars.

    Declaration
    protected Panel _mainPanel
    Field Value
    Panel

    _points

    The keyframe UI points.

    Declaration
    protected readonly List<CurveEditor<T>.KeyframePoint> _points
    Field Value
    System.Collections.Generic.List<CurveEditor.KeyframePoint<>>

    _refreshAfterEdit

    True if refresh keyframes positioning before drawing.

    Declaration
    protected bool _refreshAfterEdit
    Field Value
    System.Boolean

    _showCollapsed

    True if curve is collapsed.

    Declaration
    protected bool _showCollapsed
    Field Value
    System.Boolean

    _tangents

    The tangents UI points.

    Declaration
    protected readonly CurveEditor<T>.TangentPoint[] _tangents
    Field Value
    CurveEditor.TangentPoint<>[]

    Accessor

    The keyframes data accessor.

    Declaration
    public readonly CurveEditor<T>.IKeyframeAccess<T> Accessor
    Field Value
    CurveEditor.IKeyframeAccess<T>

    Colors

    The colors for the keyframe points.

    Declaration
    protected Color[] Colors
    Field Value
    Color[]

    DefaultValue

    The default value.

    Declaration
    public T DefaultValue
    Field Value
    T

    KeyframesSize

    The keyframes size.

    Declaration
    protected static readonly Float2 KeyframesSize
    Field Value
    Float2

    LabelsSize

    The timeline intervals metric area size (in pixels).

    Declaration
    protected static readonly float LabelsSize
    Field Value
    System.Single

    TickSteps

    The curve time/value axes tick steps.

    Declaration
    protected double[] TickSteps
    Field Value
    System.Double[]

    UnitsPerSecond

    The timeline units per second (on time axis).

    Declaration
    public static readonly float UnitsPerSecond
    Field Value
    System.Single

    Properties

    FPS

    Declaration
    public override Nullable<float> FPS { get; set; }
    Property Value
    System.Nullable<System.Single>

    Overrides
    FlaxEditor.GUI.CurveEditorBase.FPS

    IsUserEditing

    Gets a value indicating whether user is editing the curve.

    Declaration
    public bool IsUserEditing { get; }
    Property Value
    System.Boolean

    ScrollBars

    Declaration
    public override ScrollBars ScrollBars { get; set; }
    Property Value
    ScrollBars

    Overrides
    FlaxEditor.GUI.CurveEditorBase.ScrollBars

    ShowCollapsed

    Declaration
    public override bool ShowCollapsed { get; set; }
    Property Value
    System.Boolean

    Overrides
    FlaxEditor.GUI.CurveEditorBase.ShowCollapsed

    ValueType

    Declaration
    public override Type ValueType { get; }
    Property Value
    System.Type

    Overrides
    FlaxEditor.GUI.CurveEditorBase.ValueType

    ViewOffset

    Declaration
    public override Float2 ViewOffset { get; set; }
    Property Value
    Float2

    Overrides
    FlaxEditor.GUI.CurveEditorBase.ViewOffset

    ViewScale

    Declaration
    public override Float2 ViewScale { get; set; }
    Property Value
    Float2

    Overrides
    FlaxEditor.GUI.CurveEditorBase.ViewScale

    Methods

    AddKeyframe(Float2)

    Adds a new keyframe at the given location (in keyframes space).

    Declaration
    protected abstract void AddKeyframe(Float2 keyframesPos)
    Parameters
    Float2 keyframesPos

    The new keyframe position (in keyframes space).

    ClearSelection()

    Declaration
    public override void ClearSelection()
    Overrides
    FlaxEditor.GUI.CurveEditorBase.ClearSelection()

    DeselectAll()

    Deselects all keyframes.

    Declaration
    public void DeselectAll()

    Draw()

    Draw the control and the children.

    Declaration
    public override void Draw()
    Overrides
    ContainerControl.Draw()

    DrawCurve(ref Rectangle)

    Draws the curve.

    Declaration
    protected abstract void DrawCurve(ref Rectangle viewRect)
    Parameters
    Rectangle viewRect

    The main panel client area used as a view bounds.

    Evaluate(out T, Single, Boolean)

    Evaluates the animation curve value at the specified time.

    Declaration
    public abstract void Evaluate(out T result, float time, bool loop = false)
    Parameters
    T result

    The interpolated value from the curve at provided time.

    System.Single time

    The time to evaluate the curve at.

    System.Boolean loop

    If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped.

    Evaluate(out Object, Single, Boolean)

    Declaration
    public override void Evaluate(out object result, float time, bool loop = false)
    Parameters
    System.Object result

    System.Single time

    System.Boolean loop

    Overrides
    FlaxEditor.GUI.CurveEditorBase.Evaluate(System.Object, System.Single, System.Boolean)

    FocusSelection()

    Focuses the view on the selected keyframes.

    Declaration
    public void FocusSelection()

    GetAllKeyframesEditingProxy()

    Gets proxy object for all keyframes list.

    Declaration
    protected abstract CurveEditor<T>.IAllKeyframesProxy GetAllKeyframesEditingProxy()
    Returns
    CurveEditor.IAllKeyframesProxy<>

    The proxy object.

    GetKeyframeTangentInternal(Int32, Boolean, Int32)

    Gets the keyframe tangent value (internally).

    Declaration
    protected abstract float GetKeyframeTangentInternal(int index, bool isIn, int component)
    Parameters
    System.Int32 index

    The keyframe index.

    System.Boolean isIn

    True if tangent is In, otherwise it's Out.

    System.Int32 component

    The value component index.

    Returns
    System.Single

    The tangent component value.

    GetKeyframeTime(Int32)

    Gets the time of the keyframe.

    Declaration
    protected abstract float GetKeyframeTime(int index)
    Parameters
    System.Int32 index

    The keyframe index.

    Returns
    System.Single

    The keyframe time.

    GetKeyframeTime(Object)

    Gets the time of the keyframe.

    Declaration
    protected abstract float GetKeyframeTime(object keyframe)
    Parameters
    System.Object keyframe

    The keyframe object.

    Returns
    System.Single

    The keyframe time.

    GetKeyframeValue(Object)

    Gets the value of the keyframe.

    Declaration
    protected abstract T GetKeyframeValue(object keyframe)
    Parameters
    System.Object keyframe

    The keyframe object.

    Returns
    T

    The keyframe value.

    GetKeyframeValue(Object, Int32)

    Gets the value of the keyframe (single component).

    Declaration
    protected abstract float GetKeyframeValue(object keyframe, int component)
    Parameters
    System.Object keyframe

    The keyframe object.

    System.Int32 component

    The keyframe value component index.

    Returns
    System.Single

    The keyframe component value.

    OnDestroy()

    Method called when managed instance should be destroyed

    Declaration
    public override void OnDestroy()
    Overrides
    ContainerControl.OnDestroy()

    OnKeyDown(KeyboardKeys)

    When key goes down

    Declaration
    public override bool OnKeyDown(KeyboardKeys key)
    Parameters
    KeyboardKeys key

    Key value

    Returns
    System.Boolean

    True if event has been handled, otherwise false

    Overrides
    ContainerControl.OnKeyDown(KeyboardKeys)

    OnKeyframesChanged()

    Called when keyframes collection gets changed (keyframe added or removed).

    Declaration
    protected virtual void OnKeyframesChanged()

    OnKeyframesCopy(IKeyframesEditor, Nullable<Single>, StringBuilder)

    Declaration
    public override void OnKeyframesCopy(IKeyframesEditor editor, Nullable<float> timeOffset, StringBuilder data)
    Parameters
    FlaxEditor.GUI.IKeyframesEditor editor

    System.Nullable<System.Single> timeOffset

    System.Text.StringBuilder data

    Overrides
    FlaxEditor.GUI.CurveEditorBase.OnKeyframesCopy(FlaxEditor.GUI.IKeyframesEditor, System.Nullable<System.Single>, System.Text.StringBuilder)

    OnKeyframesDelete(IKeyframesEditor)

    Declaration
    public override void OnKeyframesDelete(IKeyframesEditor editor)
    Parameters
    FlaxEditor.GUI.IKeyframesEditor editor

    Overrides
    FlaxEditor.GUI.CurveEditorBase.OnKeyframesDelete(FlaxEditor.GUI.IKeyframesEditor)

    OnKeyframesDeselect(IKeyframesEditor)

    Declaration
    public override void OnKeyframesDeselect(IKeyframesEditor editor)
    Parameters
    FlaxEditor.GUI.IKeyframesEditor editor

    Overrides
    FlaxEditor.GUI.CurveEditorBase.OnKeyframesDeselect(FlaxEditor.GUI.IKeyframesEditor)

    OnKeyframesMove(IKeyframesEditor, ContainerControl, Float2, Boolean, Boolean)

    Declaration
    public override void OnKeyframesMove(IKeyframesEditor editor, ContainerControl control, Float2 location, bool start, bool end)
    Parameters
    FlaxEditor.GUI.IKeyframesEditor editor

    ContainerControl control

    Float2 location

    System.Boolean start

    System.Boolean end

    Overrides
    FlaxEditor.GUI.CurveEditorBase.OnKeyframesMove(FlaxEditor.GUI.IKeyframesEditor, FlaxEngine.GUI.ContainerControl, FlaxEngine.Float2, System.Boolean, System.Boolean)

    OnKeyframesPaste(IKeyframesEditor, Nullable<Single>, String[], ref Int32)

    Declaration
    public override void OnKeyframesPaste(IKeyframesEditor editor, Nullable<float> timeOffset, string[] datas, ref int index)
    Parameters
    FlaxEditor.GUI.IKeyframesEditor editor

    System.Nullable<System.Single> timeOffset

    System.String[] datas

    System.Int32 index

    Overrides
    FlaxEditor.GUI.CurveEditorBase.OnKeyframesPaste(FlaxEditor.GUI.IKeyframesEditor, System.Nullable<System.Single>, System.String[], System.Int32)

    OnKeyframesSelection(IKeyframesEditor, ContainerControl, Rectangle)

    Declaration
    public override void OnKeyframesSelection(IKeyframesEditor editor, ContainerControl control, Rectangle selection)
    Parameters
    FlaxEditor.GUI.IKeyframesEditor editor

    ContainerControl control

    Rectangle selection

    Overrides
    FlaxEditor.GUI.CurveEditorBase.OnKeyframesSelection(FlaxEditor.GUI.IKeyframesEditor, FlaxEngine.GUI.ContainerControl, FlaxEngine.Rectangle)

    OnKeyframesSelectionCount()

    Declaration
    public override int OnKeyframesSelectionCount()
    Returns
    System.Int32

    Overrides
    FlaxEditor.GUI.CurveEditorBase.OnKeyframesSelectionCount()

    OnShowContextMenu(ContextMenu, Int32)

    Called when showing a context menu. Can be used to add custom buttons with actions.

    Declaration
    protected virtual void OnShowContextMenu(ContextMenu cm, int selectionCount)
    Parameters
    FlaxEditor.GUI.ContextMenu.ContextMenu cm

    The menu.

    System.Int32 selectionCount

    The amount of selected keyframes.

    OnSizeChanged()

    Called when control size gets changed.

    Declaration
    protected override void OnSizeChanged()
    Overrides
    ContainerControl.OnSizeChanged()

    PointFromKeyframes(Float2, ref Rectangle)

    Converts the input point from the keyframes time/value coordinates into the curve editor control space.

    Declaration
    protected Float2 PointFromKeyframes(Float2 point, ref Rectangle curveContentAreaBounds)
    Parameters
    Float2 point

    The point.

    Rectangle curveContentAreaBounds

    The curve contents area bounds.

    Returns
    Float2

    The result.

    PointToKeyframes(Float2, ref Rectangle)

    Converts the input point from curve editor control space into the keyframes time/value coordinates.

    Declaration
    protected Float2 PointToKeyframes(Float2 point, ref Rectangle curveContentAreaBounds)
    Parameters
    Float2 point

    The point.

    Rectangle curveContentAreaBounds

    The curve contents area bounds.

    Returns
    Float2

    The result.

    RemoveKeyframesInternal(HashSet<Int32>)

    Removes the keyframes data (internally).

    Declaration
    protected abstract void RemoveKeyframesInternal(HashSet<int> indicesToRemove)
    Parameters
    System.Collections.Generic.HashSet<System.Int32> indicesToRemove

    The list of indices of the keyframes to remove.

    SelectAll()

    Selects all keyframes.

    Declaration
    public void SelectAll()

    SetKeyframeInternal(Int32, Object)

    Sets the keyframe data (internally).

    Declaration
    protected abstract void SetKeyframeInternal(int index, object keyframe)
    Parameters
    System.Int32 index

    The keyframe index.

    System.Object keyframe

    The keyframe to set.

    SetKeyframeInternal(Int32, Single, Single, Int32)

    Sets the keyframe data (internally).

    Declaration
    protected abstract void SetKeyframeInternal(int index, float time, float value, int component)
    Parameters
    System.Int32 index

    The keyframe index.

    System.Single time

    The time to set.

    System.Single value

    The value to set.

    System.Int32 component

    The value component.

    SetKeyframeTangentInternal(Int32, Boolean, Int32, Single)

    Sets the keyframe tangent value (internally).

    Declaration
    protected abstract void SetKeyframeTangentInternal(int index, bool isIn, int component, float value)
    Parameters
    System.Int32 index

    The keyframe index.

    System.Boolean isIn

    True if tangent is In, otherwise it's Out.

    System.Int32 component

    The value component index.

    System.Single value

    The tangent component value.

    ShowWholeCurve()

    Declaration
    public override void ShowWholeCurve()
    Overrides
    FlaxEditor.GUI.CurveEditorBase.ShowWholeCurve()

    UpdateFPS()

    Updates the keyframes to match the FPS.

    Declaration
    protected abstract void UpdateFPS()

    UpdateTooltips()

    Updates the keyframes tooltips.

    Declaration
    protected void UpdateTooltips()

    Events

    KeyframesChanged

    Occurs when keyframes collection gets changed (keyframe added or removed).

    Declaration
    public event Action KeyframesChanged
    Event Type
    System.Action

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.RawClone<T>(T)

    See Also

    FlaxEditor.GUI.CurveEditorBase
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat