VTK  9.2.6
vtkAnimationCue.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkAnimationCue.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
44#ifndef vtkAnimationCue_h
45#define vtkAnimationCue_h
46
47#include "vtkCommonCoreModule.h" // For export macro
48#include "vtkObject.h"
49
50class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
51{
52public:
53 vtkTypeMacro(vtkAnimationCue, vtkObject);
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
57
58 // Structure passed on every event invocation.
59 // Depending upon the cue time mode, these times are either
60 // normalized [0,1] or relative to the scene that contains the cue.
61 // All this information is also available by asking the cue
62 // directly for it within the handler. Thus, this information can
63 // be accessed in wrapped languages.
65 {
66 public:
67 double StartTime;
68 double EndTime;
69 double AnimationTime; // valid only in AnimationCueTickEvent handler
70 double DeltaTime; // valid only in AnimationCueTickEvent handler
71 double ClockTime; // valid only in AnimationCueTickEvent handler
72 };
73
75
82 virtual void SetTimeMode(int mode);
83 vtkGetMacro(TimeMode, int);
84 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
85 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
87
89
99 vtkSetMacro(StartTime, double);
100 vtkGetMacro(StartTime, double);
102
104
113 vtkSetMacro(EndTime, double);
114 vtkGetMacro(EndTime, double);
116
135 virtual void Tick(double currenttime, double deltatime, double clocktime);
136
141 virtual void Initialize();
142
148 virtual void Finalize();
149
151
156 vtkGetMacro(AnimationTime, double);
158
160
165 vtkGetMacro(DeltaTime, double);
167
169
175 vtkGetMacro(ClockTime, double);
177
179 {
180 TIMEMODE_NORMALIZED = 0,
181 TIMEMODE_RELATIVE = 1
182 };
183
184 enum class PlayDirection
185 {
186 BACKWARD,
187 FORWARD,
188 };
189
191
197
198protected:
201
202 enum
203 {
204 UNINITIALIZED = 0,
206 ACTIVE
207 };
208
209 double StartTime;
210 double EndTime;
212 PlayDirection Direction = PlayDirection::FORWARD;
213
214 // These are set when the AnimationCueTickEvent event
215 // is fired. Thus giving access to the information in
216 // the AnimationCueInfo struct in wrapped languages.
218 double DeltaTime;
219 double ClockTime;
220
225
227
232 virtual void StartCueInternal();
233 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
234 virtual void EndCueInternal();
236
238
242 virtual bool CheckStartCue(double currenttime);
243 virtual bool CheckEndCue(double currenttime);
245
246private:
247 vtkAnimationCue(const vtkAnimationCue&) = delete;
248 void operator=(const vtkAnimationCue&) = delete;
249};
250
251#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:40
abstract base class for most VTK objects
Definition: vtkObject.h:63