VTK  9.5.2
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
57
58#ifndef vtkAnimationCue_h
59#define vtkAnimationCue_h
60
61#include "vtkCommonCoreModule.h" // For export macro
62#include "vtkObject.h"
63
64VTK_ABI_NAMESPACE_BEGIN
65class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
66{
67public:
68 vtkTypeMacro(vtkAnimationCue, vtkObject);
69 void PrintSelf(ostream& os, vtkIndent indent) override;
70
72
73 // Structure passed on every event invocation.
74 // Depending upon the cue time mode, these times are either
75 // normalized [0,1] or relative to the scene that contains the cue.
76 // All this information is also available by asking the cue
77 // directly for it within the handler. Thus, this information can
78 // be accessed in wrapped languages.
80 {
81 public:
82 double StartTime;
83 double EndTime;
84 double AnimationTime; // valid only in AnimationCueTickEvent handler
85 double DeltaTime; // valid only in AnimationCueTickEvent handler
86 double ClockTime; // valid only in AnimationCueTickEvent handler
87 };
88
90
97 virtual void SetTimeMode(int mode);
98 vtkGetMacro(TimeMode, int);
102
104
114 vtkSetMacro(StartTime, double);
115 vtkGetMacro(StartTime, double);
117
119
128 vtkSetMacro(EndTime, double);
129 vtkGetMacro(EndTime, double);
131
150 virtual void Tick(double currenttime, double deltatime, double clocktime);
151
156 virtual void Initialize();
157
163 virtual void Finalize();
164
166
171 vtkGetMacro(AnimationTime, double);
173
175
180 vtkGetMacro(DeltaTime, double);
182
184
190 vtkGetMacro(ClockTime, double);
192
198
199 enum class PlayDirection
200 {
201 BACKWARD,
202 FORWARD,
203 };
204
206
212
213protected:
216
217 enum
218 {
222 };
223
224 double StartTime;
225 double EndTime;
228
229 // These are set when the AnimationCueTickEvent event
230 // is fired. Thus giving access to the information in
231 // the AnimationCueInfo struct in wrapped languages.
233 double DeltaTime;
234 double ClockTime;
235
240
242
247 virtual void StartCueInternal();
248 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
249 virtual void EndCueInternal();
251
253
257 virtual bool CheckStartCue(double currenttime);
258 virtual bool CheckEndCue(double currenttime);
260
261private:
262 vtkAnimationCue(const vtkAnimationCue&) = delete;
263 void operator=(const vtkAnimationCue&) = delete;
264};
265
266VTK_ABI_NAMESPACE_END
267#endif
PlayDirection Direction
~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