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
29#ifndef vtkAnimationCue_h
30#define vtkAnimationCue_h
31
32#include "vtkCommonCoreModule.h" // For export macro
33#include "vtkObject.h"
34
35VTK_ABI_NAMESPACE_BEGIN
36class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
37{
38public:
39 vtkTypeMacro(vtkAnimationCue, vtkObject);
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
43
44 // Structure passed on every event invocation.
45 // Depending upon the cue time mode, these times are either
46 // normalized [0,1] or relative to the scene that contains the cue.
47 // All this information is also available by asking the cue
48 // directly for it within the handler. Thus, this information can
49 // be accessed in wrapped languages.
51 {
52 public:
53 double StartTime;
54 double EndTime;
55 double AnimationTime; // valid only in AnimationCueTickEvent handler
56 double DeltaTime; // valid only in AnimationCueTickEvent handler
57 double ClockTime; // valid only in AnimationCueTickEvent handler
58 };
59
61
68 virtual void SetTimeMode(int mode);
69 vtkGetMacro(TimeMode, int);
70 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
71 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
73
75
85 vtkSetMacro(StartTime, double);
86 vtkGetMacro(StartTime, double);
88
90
99 vtkSetMacro(EndTime, double);
100 vtkGetMacro(EndTime, double);
102
121 virtual void Tick(double currenttime, double deltatime, double clocktime);
122
127 virtual void Initialize();
128
134 virtual void Finalize();
135
137
142 vtkGetMacro(AnimationTime, double);
144
146
151 vtkGetMacro(DeltaTime, double);
153
155
161 vtkGetMacro(ClockTime, double);
163
165 {
166 TIMEMODE_NORMALIZED = 0,
167 TIMEMODE_RELATIVE = 1
168 };
169
170 enum class PlayDirection
171 {
172 BACKWARD,
173 FORWARD,
174 };
175
177
183
184protected:
187
188 enum
189 {
190 UNINITIALIZED = 0,
192 ACTIVE
193 };
194
195 double StartTime;
196 double EndTime;
198 PlayDirection Direction = PlayDirection::FORWARD;
199
200 // These are set when the AnimationCueTickEvent event
201 // is fired. Thus giving access to the information in
202 // the AnimationCueInfo struct in wrapped languages.
204 double DeltaTime;
205 double ClockTime;
206
211
213
218 virtual void StartCueInternal();
219 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
220 virtual void EndCueInternal();
222
224
228 virtual bool CheckStartCue(double currenttime);
229 virtual bool CheckEndCue(double currenttime);
231
232private:
233 vtkAnimationCue(const vtkAnimationCue&) = delete;
234 void operator=(const vtkAnimationCue&) = delete;
235};
236
237VTK_ABI_NAMESPACE_END
238#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:29
abstract base class for most VTK objects
Definition vtkObject.h:49