VTK  9.3.20240720
vtkAnimationCue.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
61#ifndef vtkAnimationCue_h
62#define vtkAnimationCue_h
63
64#include "vtkCommonCoreModule.h" // For export macro
65#include "vtkObject.h"
66
67VTK_ABI_NAMESPACE_BEGIN
68class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
69{
70public:
71 vtkTypeMacro(vtkAnimationCue, vtkObject);
72 void PrintSelf(ostream& os, vtkIndent indent) override;
73
75
76 // Structure passed on every event invocation.
77 // Depending upon the cue time mode, these times are either
78 // normalized [0,1] or relative to the scene that contains the cue.
79 // All this information is also available by asking the cue
80 // directly for it within the handler. Thus, this information can
81 // be accessed in wrapped languages.
83 {
84 public:
85 double StartTime;
86 double EndTime;
87 double AnimationTime; // valid only in AnimationCueTickEvent handler
88 double DeltaTime; // valid only in AnimationCueTickEvent handler
89 double ClockTime; // valid only in AnimationCueTickEvent handler
90 };
91
93
100 virtual void SetTimeMode(int mode);
101 vtkGetMacro(TimeMode, int);
102 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
103 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
105
107
117 vtkSetMacro(StartTime, double);
118 vtkGetMacro(StartTime, double);
120
122
131 vtkSetMacro(EndTime, double);
132 vtkGetMacro(EndTime, double);
134
153 virtual void Tick(double currenttime, double deltatime, double clocktime);
154
159 virtual void Initialize();
160
166 virtual void Finalize();
167
169
174 vtkGetMacro(AnimationTime, double);
176
178
183 vtkGetMacro(DeltaTime, double);
185
187
193 vtkGetMacro(ClockTime, double);
195
197 {
198 TIMEMODE_NORMALIZED = 0,
199 TIMEMODE_RELATIVE = 1
200 };
201
202 enum class PlayDirection
203 {
204 BACKWARD,
205 FORWARD,
206 };
207
209
215
216protected:
219
220 enum
221 {
222 UNINITIALIZED = 0,
224 ACTIVE
225 };
226
227 double StartTime;
228 double EndTime;
230 PlayDirection Direction = PlayDirection::FORWARD;
231
232 // These are set when the AnimationCueTickEvent event
233 // is fired. Thus giving access to the information in
234 // the AnimationCueInfo struct in wrapped languages.
236 double DeltaTime;
237 double ClockTime;
238
243
245
250 virtual void StartCueInternal();
251 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
252 virtual void EndCueInternal();
254
256
260 virtual bool CheckStartCue(double currenttime);
261 virtual bool CheckEndCue(double currenttime);
263
264private:
265 vtkAnimationCue(const vtkAnimationCue&) = delete;
266 void operator=(const vtkAnimationCue&) = delete;
267};
268
269VTK_ABI_NAMESPACE_END
270#endif
a seqin an animation.
~vtkAnimationCue() override
void SetTimeModeToRelative()
Get/Set the time mode.
void SetTimeModeToNormalized()
Get/Set the time mode.
virtual void StartCueInternal()
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.
virtual bool CheckEndCue(double currenttime)
These test the start, end time variables with current time to decide whether the animation can begin ...
virtual void Initialize()
Called when the playing of the scene begins.
virtual void Finalize()
Called when the scene reaches the end.
vtkSetEnumMacro(Direction, PlayDirection)
Set/get the direction of playback.
virtual bool CheckStartCue(double currenttime)
These test the start, end time variables with current time to decide whether the animation can begin ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int CueState
Current state of the Cue.
static vtkAnimationCue * New()
virtual void TickInternal(double currenttime, double deltatime, double clocktime)
These are the internal methods that actually trigger they corresponding events.
virtual void SetTimeMode(int mode)
Get/Set the time mode.
virtual void Tick(double currenttime, double deltatime, double clocktime)
Indicates a tick or point in time in the animation.
vtkGetEnumMacro(Direction, PlayDirection)
Set/get the direction of playback.
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162