Skip to content

AnimationCue ​

Introduction ​

vtkAnimationCue represents a single animation cue that can be played, paused, and stopped. It tracks elapsed time between a start and end time and fires tick events each frame to drive animation logic. Cues are typically managed by a vtkAnimationScene.

Methods ​

checkEndCue ​

True when an active cue reaches its end time.

ArgumentTypeRequiredDescription
timenumberYes

checkStartCue ​

True when an uninitialized cue reaches its start time.

ArgumentTypeRequiredDescription
timenumberYes

extend ​

Method used to decorate a given object (publicAPI+model) with vtkAnimationCue characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIAnimationCueInitialValuesNo(default: {})

finalize ​

End a running cue without waiting for the time to leave its window. This invokes the end event.

getAnimationTime ​

Get the time this cue holds, on the timeline of the scene that drives it.

getClockTime ​

Get the wall clock time the last tick reported.

getCueState ​

Get the state this cue holds. Distinct from the vtkObject getState() that serializes the object.

getDeltaTime ​

Get the time step of the last tick.

getEndTime ​

Get the end time of this cue.

getStartTime ​

Get the start time of this cue.

getTime ​

Alias of getAnimationTime().

getTimeMode ​

Get how the cue reads its own start and end times.

initialize ​

Reset the cue to UNINITIALIZED for another run.

invokeEndCueEvent ​

Invoke the end event with the given event data.

ArgumentTypeRequiredDescription
eventobjectYesThe event data.

invokeStartCueEvent ​

Invoke the start event with the given event data.

ArgumentTypeRequiredDescription
eventobjectYesThe event data.

invokeTickEvent ​

Invoke the tick event with the given event data.

ArgumentTypeRequiredDescription
eventobjectYesThe tick event data.

isActive ​

Check if the cue is active (playing or paused).

isCueStarted ​

True while the cue runs, that is between the two checks above.

isPlaying ​

Check if the cue is currently playing.

newInstance ​

Method used to create a new instance of vtkAnimationCue.

ArgumentTypeRequiredDescription
initialValuesIAnimationCueInitialValuesNofor pre-setting some of its content

onEndCueEvent ​

Register a callback function invoked when the time leaves the cue window.

ArgumentTypeRequiredDescription
callbackFunctionYesFunction invoked with { time }.

onStartCueEvent ​

Register a callback function invoked when the time enters the cue window.

ArgumentTypeRequiredDescription
callbackFunctionYesFunction invoked with { time }.

onTickEvent ​

Register a callback function invoked on each tick.

ArgumentTypeRequiredDescription
callbackFunctionYesFunction invoked with { time, deltaTime, clockTime }.

pause ​

Pause the cue. Does nothing unless the cue is playing.

play ​

Start playing the cue. A paused active cue continues from the time it holds; an uninitialized or inactive cue starts from the start time.

seek ​

Alias of setAnimationTime().

ArgumentTypeRequiredDescription
timenumberYesTime within the cue, clamped to its bounds.

setAnimationTime ​

Move to a time inside the cue and report it through the tick event without changing its lifecycle state, so a scene can scrub without starting it.

ArgumentTypeRequiredDescription
timenumberYesTime within the cue, clamped to its bounds.

setEndTime ​

Set the end time of this cue.

ArgumentTypeRequiredDescription
endTimenumberYesThe end time.

setStartTime ​

Set the start time of this cue.

ArgumentTypeRequiredDescription
startTimenumberYesThe start time.

setTimeMode ​

Set how the cue reads its own start and end times.

ArgumentTypeRequiredDescription
timeModenumberYesOne of TimeMode.

setTimeModeToNormalized ​

Read the start and end times as fractions of the scene duration.

setTimeModeToRelative ​

Read the start and end times on the timeline of the scene.

stop ​

Stop the cue and reset it to the start time. Does nothing when the cue is already stopped at the start time.

tick ​

Called by the animation scene to update cue time each frame. An UNINITIALIZED cue enters its window on its own and an INACTIVE cue ignores subsequent ticks.

ArgumentTypeRequiredDescription
currentTimenumberYesTime the scene held before this step.
deltaTimenumberYesLength of this step.
clockTimenumberNoWall clock time, reported by getClockTime().