ACurveEditor
- Module
- Arc
- Header
#include "Arc/Widgets/ACurveEditor.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
ArcDelegate<void(const CArcCurve&)> | OnCurveChanged | |
ArcDelegate<void(int32_t)> | OnKeySelectionChanged |
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | ||
ArcVec2 | ComputeDesiredSize | |
int32_t | OnPaint | |
CReply | OnMouseButtonDown | |
CReply | OnMouseButtonUp | |
CReply | OnMouseMove | |
CReply | OnMouseWheel | |
CReply | OnKeyDown | |
bool | IsFocusable | |
EFocusVisual | GetFocusVisual | The canvas shows focus as its BorderNormal frame and the focused key carries the ring; a second ring round the whole plot would be noise. |
void | PaintKey | The design's curve-key: a 9 px square turned 45 degrees, filled by state (TextBright, AccentHover hovered, AccentColor pressed or selected, TextDisabled, Error), with the FocusRing around it when focused. |
void | PaintTangent | A selected key's tangent: the 1 px line and the 6 px round handle. |
void | PaintCanvas | The canvas: TimelineBg, PanelBorder (BorderNormal while focused). |
bool | TangentModeForDigit | Interpolation by the curve-key shortcut: 1 auto, 2 user, 3 linear, 4 constant. |
bool | SetKeyInterpolation | Sets a key's interpolation the way the 1-4 shortcuts do. |
void | ApplyTangentDrag | What a handle drag does to the key: the dragged side takes the slope, the other side follows unless the tangents are broken or Alt is held (which breaks them). |
void | SetCurve | |
const CArcCurve& | GetCurve | |
int32_t | GetSelectedKey | |
void | SelectKey | |
bool | UpdateKey | |
void | SetViewRange | |
void | FrameViewToKeys | |
void | SetPopupTitle | |
void | SetPopupEnabled | |
void | OpenPresetPopup | |
EArcCursorType | OnCursorQuery | |
const char* | GetTypeName |
Function details
ARC_WIDGET_ARGS
ARC_WIDGET_ARGS(ACurveEditor) ARC_ARG(float, MinTime) ARC_ARG(float, MaxTime) ARC_ARG(float, MinValue) ARC_ARG(float, MaxValue) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)ComputeDesiredSize
ArcVec2 ComputeDesiredSize(float scale) const overrideOnPaint
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideOnMouseButtonDown
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonUp
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseMove
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseWheel
CReply OnMouseWheel(const CGeometry& geo, const CPointerEvent& event) overrideOnKeyDown
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) overrideIsFocusable
bool IsFocusable() const overrideGetFocusVisual
EFocusVisual GetFocusVisual() const overrideThe canvas shows focus as its BorderNormal frame and the focused key carries the ring; a second ring round the whole plot would be noise.
PaintKey
static void PaintKey(CArcUIRenderer& renderer, const ArcVec2& center, Mowo::EArcSpecState state, float opacity = 1.0f)The design's curve-key: a 9 px square turned 45 degrees, filled by state (TextBright, AccentHover hovered, AccentColor pressed or selected, TextDisabled, Error), with the FocusRing around it when focused. Every curve canvas paints its keys with this.
PaintTangent
static void PaintTangent(CArcUIRenderer& renderer, const ArcVec2& key, const ArcVec2& handle, float opacity = 1.0f)A selected key's tangent: the 1 px line and the 6 px round handle.
PaintCanvas
static void PaintCanvas(CArcUIRenderer& renderer, const ArcRect& rect, bool focused, float opacity = 1.0f)The canvas: TimelineBg, PanelBorder (BorderNormal while focused).
TangentModeForDigit
static bool TangentModeForDigit(int32_t digit, ECurveTangentMode& outMode)Interpolation by the curve-key shortcut: 1 auto, 2 user, 3 linear, 4 constant. Returns false for any other digit.
SetKeyInterpolation
bool SetKeyInterpolation(int32_t index, ECurveTangentMode mode)Sets a key's interpolation the way the 1-4 shortcuts do.
ApplyTangentDrag
static void ApplyTangentDrag(CArcCurveKey& key, bool arrive, float slope, bool breakTangents)What a handle drag does to the key: the dragged side takes the slope, the other side follows unless the tangents are broken or Alt is held (which breaks them).
SetCurve
void SetCurve(const CArcCurve& curve)GetCurve
const CArcCurve& GetCurve() constGetSelectedKey
int32_t GetSelectedKey() constSelectKey
void SelectKey(int32_t index)UpdateKey
bool UpdateKey(int32_t index, const CArcCurveKey& key)SetViewRange
void SetViewRange(float minTime, float maxTime, float minValue, float maxValue)FrameViewToKeys
void FrameViewToKeys(float padRatio = 0.15f)SetPopupTitle
void SetPopupTitle(const std::string& title)SetPopupEnabled
void SetPopupEnabled(bool enabled)OpenPresetPopup
void OpenPresetPopup()OnCursorQuery
EArcCursorType OnCursorQuery(const CGeometry& geo, const CPointerEvent& event) const overrideGetTypeName
const char* GetTypeName() const override