VTK: Common/Core/vtkAnimationCue.h Source File

| VTK 9.3.1

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
41 #ifndef vtkAnimationCue_h
42 #define vtkAnimationCue_h
43
44 #include "vtkCommonCoreModule.h" // For export macro
45 #include "vtkObject.h"
46
47 VTK_ABI_NAMESPACE_BEGIN
48 class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
49 {
50 public:
51 vtkTypeMacro(vtkAnimationCue, vtkObject);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
54 static vtkAnimationCue* New();
55
56 // Structure passed on every event invocation.
57 // Depending upon the cue time mode, these times are either
58 // normalized [0,1] or relative to the scene that contains the cue.
59 // All this information is also available by asking the cue
60 // directly for it within the handler. Thus, this information can
61 // be accessed in wrapped languages.
62 class AnimationCueInfo
63 {
64 public:
65 double StartTime;
66 double EndTime;
67 double AnimationTime; // valid only in AnimationCueTickEvent handler
68 double DeltaTime; // valid only in AnimationCueTickEvent handler
69 double ClockTime; // valid only in AnimationCueTickEvent handler
70 };
71
73
80 virtual void SetTimeMode(int mode);
81 vtkGetMacro(TimeMode, int);
82 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
83 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
85
87
97 vtkSetMacro(StartTime, double);
98 vtkGetMacro(StartTime, double);
100
102
111 vtkSetMacro(EndTime, double);
112 vtkGetMacro(EndTime, double);
114
133 virtual void Tick(double currenttime, double deltatime, double clocktime);
134
139 virtual void Initialize();
140
146 virtual void Finalize();
147
149
154 vtkGetMacro(AnimationTime, double);
156
158
163 vtkGetMacro(DeltaTime, double);
165
167
173 vtkGetMacro(ClockTime, double);
175
176 enum TimeCodes
177 {
178 TIMEMODE_NORMALIZED = 0,
179 TIMEMODE_RELATIVE = 1
180 };
181
182 enum class PlayDirection
183 {
184 BACKWARD,
185 FORWARD,
186 };
187
189
192 vtkSetEnumMacro(Direction, PlayDirection);
193 vtkGetEnumMacro(Direction, PlayDirection);
195
196 protected:
197 vtkAnimationCue();
198 ~vtkAnimationCue() override;
199
200 enum
201 {
202 UNINITIALIZED = 0,
203 INACTIVE,
204 ACTIVE
205 };
206
207 double StartTime;
208 double EndTime;
209 int TimeMode;
210 PlayDirection Direction = PlayDirection::FORWARD;
211
212 // These are set when the AnimationCueTickEvent event
213 // is fired. Thus giving access to the information in
214 // the AnimationCueInfo struct in wrapped languages.
215 double AnimationTime;
216 double DeltaTime;
217 double ClockTime;
218
222 int CueState;
223
225
230 virtual void StartCueInternal();
231 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
232 virtual void EndCueInternal();
234
236
240 virtual bool CheckStartCue(double currenttime);
241 virtual bool CheckEndCue(double currenttime);
243
244 private:
245 vtkAnimationCue(const vtkAnimationCue&) = delete;
246 void operator=(const vtkAnimationCue&) = delete;
247 };
248
249 VTK_ABI_NAMESPACE_END
250 #endif
vtkAnimationCue::AnimationCueInfo
Definition: vtkAnimationCue.h:63
vtkAnimationCue::AnimationCueInfo::StartTime
double StartTime
Definition: vtkAnimationCue.h:65
vtkAnimationCue::AnimationCueInfo::DeltaTime
double DeltaTime
Definition: vtkAnimationCue.h:68
vtkAnimationCue::AnimationCueInfo::ClockTime
double ClockTime
Definition: vtkAnimationCue.h:69
vtkAnimationCue::AnimationCueInfo::AnimationTime
double AnimationTime
Definition: vtkAnimationCue.h:67
vtkAnimationCue::AnimationCueInfo::EndTime
double EndTime
Definition: vtkAnimationCue.h:66
vtkAnimationCue
a seqin an animation.
Definition: vtkAnimationCue.h:49
vtkAnimationCue::New
static vtkAnimationCue * New()
vtkAnimationCue::PlayDirection
PlayDirection
Definition: vtkAnimationCue.h:183
vtkAnimationCue::~vtkAnimationCue
~vtkAnimationCue() override
vtkAnimationCue::SetTimeModeToRelative
void SetTimeModeToRelative()
Get/Set the time mode.
Definition: vtkAnimationCue.h:82
vtkAnimationCue::SetTimeModeToNormalized
void SetTimeModeToNormalized()
Get/Set the time mode.
Definition: vtkAnimationCue.h:83
vtkAnimationCue::StartTime
double StartTime
Definition: vtkAnimationCue.h:207
vtkAnimationCue::StartCueInternal
virtual void StartCueInternal()
These are the internal methods that actually trigger they corresponding events.
vtkAnimationCue::EndCueInternal
virtual void EndCueInternal()
These are the internal methods that actually trigger they corresponding events.
vtkAnimationCue::CheckEndCue
virtual bool CheckEndCue(double currenttime)
These test the start, end time variables with current time to decide whether the animation can begin ...
vtkAnimationCue::Initialize
virtual void Initialize()
Called when the playing of the scene begins.
vtkAnimationCue::Finalize
virtual void Finalize()
Called when the scene reaches the end.
vtkAnimationCue::vtkSetEnumMacro
vtkSetEnumMacro(Direction, PlayDirection)
Set/get the direction of playback.
vtkAnimationCue::EndTime
double EndTime
Definition: vtkAnimationCue.h:208
vtkAnimationCue::CheckStartCue
virtual bool CheckStartCue(double currenttime)
These test the start, end time variables with current time to decide whether the animation can begin ...
vtkAnimationCue::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAnimationCue::AnimationTime
double AnimationTime
Definition: vtkAnimationCue.h:215
vtkAnimationCue::CueState
int CueState
Current state of the Cue.
Definition: vtkAnimationCue.h:222
vtkAnimationCue::INACTIVE
@ INACTIVE
Definition: vtkAnimationCue.h:203
vtkAnimationCue::TickInternal
virtual void TickInternal(double currenttime, double deltatime, double clocktime)
These are the internal methods that actually trigger they corresponding events.
vtkAnimationCue::ClockTime
double ClockTime
Definition: vtkAnimationCue.h:217
vtkAnimationCue::vtkAnimationCue
vtkAnimationCue()
vtkAnimationCue::DeltaTime
double DeltaTime
Definition: vtkAnimationCue.h:216
vtkAnimationCue::SetTimeMode
virtual void SetTimeMode(int mode)
Get/Set the time mode.
vtkAnimationCue::TimeCodes
TimeCodes
Definition: vtkAnimationCue.h:177
vtkAnimationCue::Tick
virtual void Tick(double currenttime, double deltatime, double clocktime)
Indicates a tick or point in time in the animation.
vtkAnimationCue::TimeMode
int TimeMode
Definition: vtkAnimationCue.h:209
vtkAnimationCue::vtkGetEnumMacro
vtkGetEnumMacro(Direction, PlayDirection)
Set/get the direction of playback.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkX3D::mode
@ mode
Definition: vtkX3D.h:247
vtkObject.h