VTK  9.4.20241209
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
vtkAnimationCue Class Reference

a seqin an animation. More...

#include <vtkAnimationCue.h>

Inheritance diagram for vtkAnimationCue:
[legend]
Collaboration diagram for vtkAnimationCue:
[legend]

Classes

class  AnimationCueInfo
 

Public Types

enum  TimeCodes { TIMEMODE_NORMALIZED = 0 , TIMEMODE_RELATIVE = 1 }
 
enum class  PlayDirection { BACKWARD , FORWARD }
 
typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
vtkAnimationCueNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
virtual void Tick (double currenttime, double deltatime, double clocktime)
 Indicates a tick or point in time in the animation.
 
virtual void Initialize ()
 Called when the playing of the scene begins.
 
virtual void Finalize ()
 Called when the scene reaches the end.
 
virtual void SetTimeMode (int mode)
 Get/Set the time mode.
 
virtual int GetTimeMode ()
 Get/Set the time mode.
 
void SetTimeModeToRelative ()
 Get/Set the time mode.
 
void SetTimeModeToNormalized ()
 Get/Set the time mode.
 
virtual void SetStartTime (double)
 Get/Set the Start time for this cue.
 
virtual double GetStartTime ()
 Get/Set the Start time for this cue.
 
virtual void SetEndTime (double)
 Get/Set the End time for this cue.
 
virtual double GetEndTime ()
 Get/Set the End time for this cue.
 
virtual double GetAnimationTime ()
 This is valid only in a AnimationCueTickEvent handler.
 
virtual double GetDeltaTime ()
 This is valid only in a AnimationCueTickEvent handler.
 
virtual double GetClockTime ()
 This is valid only in a AnimationCueTickEvent handler.
 
 vtkSetEnumMacro (Direction, PlayDirection)
 Set/get the direction of playback.
 
 vtkGetEnumMacro (Direction, PlayDirection)
 Set/get the direction of playback.
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on.
 
virtual void DebugOff ()
 Turn debugging output off.
 
bool GetDebug ()
 Get the value of the debug flag.
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag.
 
virtual void Modified ()
 Update the modification time for this object.
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
vtkTypeBool InvokeEvent (unsigned long event)
 
vtkTypeBool InvokeEvent (const char *event)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output.
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method.
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes.
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes.
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string.
 
virtual std::string GetObjectDescription () const
 The object description printed in messages and PrintSelf output.
 
virtual vtkTypeBool IsA (const char *name)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
virtual void Delete ()
 Delete a VTK object.
 
virtual void FastDelete ()
 Delete a reference to this object.
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream.
 
void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object).
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object).
 
int GetReferenceCount ()
 Return the current reference count of this object.
 
void SetReferenceCount (int)
 Sets the reference count.
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space.
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not.
 

Static Public Member Functions

static vtkTypeBool IsTypeOf (const char *type)
 
static vtkAnimationCueSafeDownCast (vtkObjectBase *o)
 
static vtkAnimationCueNew ()
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes.
 
static void SetGlobalWarningDisplay (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class.
 
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space.
 

Protected Types

enum  { UNINITIALIZED = 0 , INACTIVE , ACTIVE }
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkAnimationCue ()
 
 ~vtkAnimationCue () override
 
virtual void StartCueInternal ()
 These are the internal methods that actually trigger they corresponding events.
 
virtual void TickInternal (double currenttime, double deltatime, double clocktime)
 These are the internal methods that actually trigger they corresponding events.
 
virtual void EndCueInternal ()
 These are the internal methods that actually trigger they corresponding events.
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events.
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events.
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void RegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
virtual void ObjectFinalize ()
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

double StartTime
 
double EndTime
 
int TimeMode
 
PlayDirection Direction = PlayDirection::FORWARD
 
double AnimationTime
 
double DeltaTime
 
double ClockTime
 
int CueState
 Current state of the Cue.
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
std::string ObjectName
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 
virtual bool CheckStartCue (double currenttime)
 These test the start, end time variables with current time to decide whether the animation can begin or end.
 
virtual bool CheckEndCue (double currenttime)
 These test the start, end time variables with current time to decide whether the animation can begin or end.
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 

Detailed Description

a seqin an animation.

vtkAnimationCue and vtkAnimationScene provide the framework to support animations in VTK. vtkAnimationCue represents an entity that changes/ animates with time, while vtkAnimationScene represents scene or setup for the animation, which consists on individual cues or other scenes.

A cue has three states: UNINITIALIZED, ACTIVE and INACTIVE. UNINITIALIZED represents an point in time before the start time of the cue. The cue is in ACTIVE state at a point in time between start time and end time for the cue. While, beyond the end time, it is in INACTIVE state. When the cue enters the ACTIVE state, StartAnimationCueEvent is fired. This event may be handled to initialize the entity to be animated. When the cue leaves the ACTIVE state, EndAnimationCueEvent is fired, which can be handled to cleanup after having run the animation. For every request to render during the ACTIVE state, AnimationCueTickEvent is fired, which must be handled to perform the actual animation.

See also
vtkAnimationScene
Events:
vtkCommand::AnimationCueTickEvent vtkCommand::EndAnimationCueEvent vtkCommand::StartAnimationCueEvent
Online Examples:

Tests:
vtkAnimationCue (Tests)

Definition at line 68 of file vtkAnimationCue.h.

Member Typedef Documentation

◆ Superclass

Definition at line 71 of file vtkAnimationCue.h.

Member Enumeration Documentation

◆ TimeCodes

Enumerator
TIMEMODE_NORMALIZED 
TIMEMODE_RELATIVE 

Definition at line 196 of file vtkAnimationCue.h.

◆ PlayDirection

enum class vtkAnimationCue::PlayDirection
strong
Enumerator
BACKWARD 
FORWARD 

Definition at line 202 of file vtkAnimationCue.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
UNINITIALIZED 
INACTIVE 
ACTIVE 

Definition at line 220 of file vtkAnimationCue.h.

Constructor & Destructor Documentation

◆ vtkAnimationCue()

vtkAnimationCue::vtkAnimationCue ( )
protected

◆ ~vtkAnimationCue()

vtkAnimationCue::~vtkAnimationCue ( )
overrideprotected

Member Function Documentation

◆ IsTypeOf()

static vtkTypeBool vtkAnimationCue::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkAnimationCue::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

Reimplemented in vtkAnimationScene.

◆ SafeDownCast()

static vtkAnimationCue * vtkAnimationCue::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkAnimationCue::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented in vtkAnimationScene.

◆ NewInstance()

vtkAnimationCue * vtkAnimationCue::NewInstance ( ) const

◆ PrintSelf()

void vtkAnimationCue::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObjectBase.

Reimplemented in vtkAnimationScene.

◆ New()

static vtkAnimationCue * vtkAnimationCue::New ( )
static

◆ SetTimeMode()

virtual void vtkAnimationCue::SetTimeMode ( int  mode)
virtual

Get/Set the time mode.

In Normalized mode, the start and end times of the cue are normalized [0,1] with respect to the start and end times of the container scene. In Relative mode the start and end time of the cue are specified in offset seconds relative to the start time of the container scene.

Reimplemented in vtkAnimationScene.

◆ GetTimeMode()

virtual int vtkAnimationCue::GetTimeMode ( )
virtual

Get/Set the time mode.

In Normalized mode, the start and end times of the cue are normalized [0,1] with respect to the start and end times of the container scene. In Relative mode the start and end time of the cue are specified in offset seconds relative to the start time of the container scene.

◆ SetTimeModeToRelative()

void vtkAnimationCue::SetTimeModeToRelative ( )
inline

Get/Set the time mode.

In Normalized mode, the start and end times of the cue are normalized [0,1] with respect to the start and end times of the container scene. In Relative mode the start and end time of the cue are specified in offset seconds relative to the start time of the container scene.

Definition at line 102 of file vtkAnimationCue.h.

◆ SetTimeModeToNormalized()

void vtkAnimationCue::SetTimeModeToNormalized ( )
inline

Get/Set the time mode.

In Normalized mode, the start and end times of the cue are normalized [0,1] with respect to the start and end times of the container scene. In Relative mode the start and end time of the cue are specified in offset seconds relative to the start time of the container scene.

Definition at line 103 of file vtkAnimationCue.h.

◆ SetStartTime()

virtual void vtkAnimationCue::SetStartTime ( double  )
virtual

Get/Set the Start time for this cue.

When the current time is >= StartTime, the Cue is in ACTIVE state. if Current time i < StartTime, the Cue is in UNINITIALIZED state. Whenever the cue enters the ACTIVE state from an INACTIVE state, it triggers the StartEvent. The Start time is in seconds relative to the start of the container Scene (when in Relative time mode) or is normalized over the span of the container Scene (when in Normalized time mode).

◆ GetStartTime()

virtual double vtkAnimationCue::GetStartTime ( )
virtual

Get/Set the Start time for this cue.

When the current time is >= StartTime, the Cue is in ACTIVE state. if Current time i < StartTime, the Cue is in UNINITIALIZED state. Whenever the cue enters the ACTIVE state from an INACTIVE state, it triggers the StartEvent. The Start time is in seconds relative to the start of the container Scene (when in Relative time mode) or is normalized over the span of the container Scene (when in Normalized time mode).

◆ SetEndTime()

virtual void vtkAnimationCue::SetEndTime ( double  )
virtual

Get/Set the End time for this cue.

When the current time is > EndTime, the Cue is in INACTIVE state. Whenever the cue leaves an ACTIVE state to enter INACTIVE state, the EndEvent is triggered. The End time is in seconds relative to the start of the container Scene (when in Relative time mode) or is normalized over the span of the container Scene (when in Normalized time mode).

◆ GetEndTime()

virtual double vtkAnimationCue::GetEndTime ( )
virtual

Get/Set the End time for this cue.

When the current time is > EndTime, the Cue is in INACTIVE state. Whenever the cue leaves an ACTIVE state to enter INACTIVE state, the EndEvent is triggered. The End time is in seconds relative to the start of the container Scene (when in Relative time mode) or is normalized over the span of the container Scene (when in Normalized time mode).

◆ Tick()

virtual void vtkAnimationCue::Tick ( double  currenttime,
double  deltatime,
double  clocktime 
)
virtual

Indicates a tick or point in time in the animation.

Triggers a Tick event if currenttime >= StartTime and currenttime <= EndTime. Whenever the state of the cue changes, either StartEvent or EndEvent is triggered depending upon whether the cue entered Active state or quit active state respectively. The current time is relative to the start of the container Scene (when in Relative time mode) or is normalized over the span of the container Scene (when in Normalized time mode). deltatime is the time since last call to Tick. deltatime also can be in seconds relative to the start of the container Scene or normalized depending upon the cue's Time mode. clocktime is the time from the scene i.e. it does not depend on the time mode for the cue. For the first call to Tick after a call to Initialize(), the deltatime is 0;

◆ Initialize()

virtual void vtkAnimationCue::Initialize ( )
virtual

Called when the playing of the scene begins.

This will set the Cue to UNINITIALIZED state.

◆ Finalize()

virtual void vtkAnimationCue::Finalize ( )
virtual

Called when the scene reaches the end.

If the cue state is ACTIVE when this method is called, this will trigger a EndAnimationCueEvent.

◆ GetAnimationTime()

virtual double vtkAnimationCue::GetAnimationTime ( )
virtual

This is valid only in a AnimationCueTickEvent handler.

Before firing the event the animation cue sets the AnimationTime to the time of the tick.

◆ GetDeltaTime()

virtual double vtkAnimationCue::GetDeltaTime ( )
virtual

This is valid only in a AnimationCueTickEvent handler.

Before firing the event the animation cue sets the DeltaTime to the difference in time between the current tick and the last tick.

◆ GetClockTime()

virtual double vtkAnimationCue::GetClockTime ( )
virtual

This is valid only in a AnimationCueTickEvent handler.

Before firing the event the animation cue sets the ClockTime to the time of the tick. ClockTime is directly the time from the animation scene neither normalized nor offsetted to the start of the scene.

◆ vtkSetEnumMacro()

vtkAnimationCue::vtkSetEnumMacro ( Direction  ,
PlayDirection   
)

Set/get the direction of playback.

◆ vtkGetEnumMacro()

vtkAnimationCue::vtkGetEnumMacro ( Direction  ,
PlayDirection   
)

Set/get the direction of playback.

◆ StartCueInternal()

virtual void vtkAnimationCue::StartCueInternal ( )
protectedvirtual

These are the internal methods that actually trigger they corresponding events.

Subclasses can override these to do extra processing at start/end or on tick.

Reimplemented in vtkAnimationScene.

◆ TickInternal()

virtual void vtkAnimationCue::TickInternal ( double  currenttime,
double  deltatime,
double  clocktime 
)
protectedvirtual

These are the internal methods that actually trigger they corresponding events.

Subclasses can override these to do extra processing at start/end or on tick.

Reimplemented in vtkAnimationScene.

◆ EndCueInternal()

virtual void vtkAnimationCue::EndCueInternal ( )
protectedvirtual

These are the internal methods that actually trigger they corresponding events.

Subclasses can override these to do extra processing at start/end or on tick.

Reimplemented in vtkAnimationScene.

◆ CheckStartCue()

virtual bool vtkAnimationCue::CheckStartCue ( double  currenttime)
protectedvirtual

These test the start, end time variables with current time to decide whether the animation can begin or end.

◆ CheckEndCue()

virtual bool vtkAnimationCue::CheckEndCue ( double  currenttime)
protectedvirtual

These test the start, end time variables with current time to decide whether the animation can begin or end.

Member Data Documentation

◆ StartTime

double vtkAnimationCue::StartTime
protected

Definition at line 227 of file vtkAnimationCue.h.

◆ EndTime

double vtkAnimationCue::EndTime
protected

Definition at line 228 of file vtkAnimationCue.h.

◆ TimeMode

int vtkAnimationCue::TimeMode
protected

Definition at line 229 of file vtkAnimationCue.h.

◆ Direction

PlayDirection vtkAnimationCue::Direction = PlayDirection::FORWARD
protected

Definition at line 230 of file vtkAnimationCue.h.

◆ AnimationTime

double vtkAnimationCue::AnimationTime
protected

Definition at line 235 of file vtkAnimationCue.h.

◆ DeltaTime

double vtkAnimationCue::DeltaTime
protected

Definition at line 236 of file vtkAnimationCue.h.

◆ ClockTime

double vtkAnimationCue::ClockTime
protected

Definition at line 237 of file vtkAnimationCue.h.

◆ CueState

int vtkAnimationCue::CueState
protected

Current state of the Cue.

Definition at line 242 of file vtkAnimationCue.h.


The documentation for this class was generated from the following file: