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=========================================================================*/
73#ifndef vtkAnimationCue_h
74#define vtkAnimationCue_h
75
76#include "vtkCommonCoreModule.h" // For export macro
77#include "vtkObject.h"
78
79class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
80{
81public:
82 vtkTypeMacro(vtkAnimationCue, vtkObject);
83 void PrintSelf(ostream& os, vtkIndent indent) override;
84
86
87 // Structure passed on every event invocation.
88 // Depending upon the cue time mode, these times are either
89 // normalized [0,1] or relative to the scene that contains the cue.
90 // All this information is also available by asking the cue
91 // directly for it within the handler. Thus, this information can
92 // be accessed in wrapped languages.
94 {
95 public:
96 double StartTime;
97 double EndTime;
98 double AnimationTime; // valid only in AnimationCueTickEvent handler
99 double DeltaTime; // valid only in AnimationCueTickEvent handler
100 double ClockTime; // valid only in AnimationCueTickEvent handler
101 };
102
104
111 virtual void SetTimeMode(int mode);
112 vtkGetMacro(TimeMode, int);
113 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
114 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
116
118
128 vtkSetMacro(StartTime, double);
129 vtkGetMacro(StartTime, double);
131
133
142 vtkSetMacro(EndTime, double);
143 vtkGetMacro(EndTime, double);
145
164 virtual void Tick(double currenttime, double deltatime, double clocktime);
165
170 virtual void Initialize();
171
177 virtual void Finalize();
178
180
185 vtkGetMacro(AnimationTime, double);
187
189
194 vtkGetMacro(DeltaTime, double);
196
198
204 vtkGetMacro(ClockTime, double);
206
208 {
209 TIMEMODE_NORMALIZED = 0,
210 TIMEMODE_RELATIVE = 1
211 };
212
213 enum class PlayDirection
214 {
215 BACKWARD,
216 FORWARD,
217 };
218
220
226
227protected:
230
231 enum
232 {
233 UNINITIALIZED = 0,
235 ACTIVE
236 };
237
238 double StartTime;
239 double EndTime;
241 PlayDirection Direction = PlayDirection::FORWARD;
242
243 // These are set when the AnimationCueTickEvent event
244 // is fired. Thus giving access to the information in
245 // the AnimationCueInfo struct in wrapped languages.
247 double DeltaTime;
248 double ClockTime;
249
254
256
261 virtual void StartCueInternal();
262 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
263 virtual void EndCueInternal();
265
267
271 virtual bool CheckStartCue(double currenttime);
272 virtual bool CheckEndCue(double currenttime);
274
275private:
276 vtkAnimationCue(const vtkAnimationCue&) = delete;
277 void operator=(const vtkAnimationCue&) = delete;
278};
279
280#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:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
@ mode
Definition: vtkX3D.h:253