VTK  9.3.0
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
38#ifndef vtkAnimationCue_h
39#define vtkAnimationCue_h
40
41#include "vtkCommonCoreModule.h" // For export macro
42#include "vtkObject.h"
43
44VTK_ABI_NAMESPACE_BEGIN
45class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
46{
47public:
48 vtkTypeMacro(vtkAnimationCue, vtkObject);
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
52
53 // Structure passed on every event invocation.
54 // Depending upon the cue time mode, these times are either
55 // normalized [0,1] or relative to the scene that contains the cue.
56 // All this information is also available by asking the cue
57 // directly for it within the handler. Thus, this information can
58 // be accessed in wrapped languages.
60 {
61 public:
62 double StartTime;
63 double EndTime;
64 double AnimationTime; // valid only in AnimationCueTickEvent handler
65 double DeltaTime; // valid only in AnimationCueTickEvent handler
66 double ClockTime; // valid only in AnimationCueTickEvent handler
67 };
68
70
77 virtual void SetTimeMode(int mode);
78 vtkGetMacro(TimeMode, int);
79 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
80 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
82
84
94 vtkSetMacro(StartTime, double);
95 vtkGetMacro(StartTime, double);
97
99
108 vtkSetMacro(EndTime, double);
109 vtkGetMacro(EndTime, double);
111
130 virtual void Tick(double currenttime, double deltatime, double clocktime);
131
136 virtual void Initialize();
137
143 virtual void Finalize();
144
146
151 vtkGetMacro(AnimationTime, double);
153
155
160 vtkGetMacro(DeltaTime, double);
162
164
170 vtkGetMacro(ClockTime, double);
172
174 {
175 TIMEMODE_NORMALIZED = 0,
176 TIMEMODE_RELATIVE = 1
177 };
178
179 enum class PlayDirection
180 {
181 BACKWARD,
182 FORWARD,
183 };
184
186
192
193protected:
196
197 enum
198 {
199 UNINITIALIZED = 0,
201 ACTIVE
202 };
203
204 double StartTime;
205 double EndTime;
207 PlayDirection Direction = PlayDirection::FORWARD;
208
209 // These are set when the AnimationCueTickEvent event
210 // is fired. Thus giving access to the information in
211 // the AnimationCueInfo struct in wrapped languages.
213 double DeltaTime;
214 double ClockTime;
215
220
222
227 virtual void StartCueInternal();
228 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
229 virtual void EndCueInternal();
231
233
237 virtual bool CheckStartCue(double currenttime);
238 virtual bool CheckEndCue(double currenttime);
240
241private:
242 vtkAnimationCue(const vtkAnimationCue&) = delete;
243 void operator=(const vtkAnimationCue&) = delete;
244};
245
246VTK_ABI_NAMESPACE_END
247#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:38
abstract base class for most VTK objects
Definition vtkObject.h:58