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=========================================================================*/
70#ifndef vtkAnimationCue_h
71#define vtkAnimationCue_h
72
73#include "vtkCommonCoreModule.h" // For export macro
74#include "vtkObject.h"
75
76class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
77{
78public:
79 vtkTypeMacro(vtkAnimationCue, vtkObject);
80 void PrintSelf(ostream& os, vtkIndent indent) override;
81
83
84 // Structure passed on every event invocation.
85 // Depending upon the cue time mode, these times are either
86 // normalized [0,1] or relative to the scene that contains the cue.
87 // All this information is also available by asking the cue
88 // directly for it within the handler. Thus, this information can
89 // be accessed in wrapped languages.
91 {
92 public:
93 double StartTime;
94 double EndTime;
95 double AnimationTime; // valid only in AnimationCueTickEvent handler
96 double DeltaTime; // valid only in AnimationCueTickEvent handler
97 double ClockTime; // valid only in AnimationCueTickEvent handler
98 };
99
101
108 virtual void SetTimeMode(int mode);
109 vtkGetMacro(TimeMode, int);
110 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
111 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
113
115
125 vtkSetMacro(StartTime, double);
126 vtkGetMacro(StartTime, double);
128
130
139 vtkSetMacro(EndTime, double);
140 vtkGetMacro(EndTime, double);
142
161 virtual void Tick(double currenttime, double deltatime, double clocktime);
162
167 virtual void Initialize();
168
174 virtual void Finalize();
175
177
182 vtkGetMacro(AnimationTime, double);
184
186
191 vtkGetMacro(DeltaTime, double);
193
195
201 vtkGetMacro(ClockTime, double);
203
205 {
206 TIMEMODE_NORMALIZED = 0,
207 TIMEMODE_RELATIVE = 1
208 };
209
210 enum class PlayDirection
211 {
212 BACKWARD,
213 FORWARD,
214 };
215
217
223
224protected:
227
228 enum
229 {
230 UNINITIALIZED = 0,
232 ACTIVE
233 };
234
235 double StartTime;
236 double EndTime;
238 PlayDirection Direction = PlayDirection::FORWARD;
239
240 // These are set when the AnimationCueTickEvent event
241 // is fired. Thus giving access to the information in
242 // the AnimationCueInfo struct in wrapped languages.
244 double DeltaTime;
245 double ClockTime;
246
251
253
258 virtual void StartCueInternal();
259 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
260 virtual void EndCueInternal();
262
264
268 virtual bool CheckStartCue(double currenttime);
269 virtual bool CheckEndCue(double currenttime);
271
272private:
273 vtkAnimationCue(const vtkAnimationCue&) = delete;
274 void operator=(const vtkAnimationCue&) = delete;
275};
276
277#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:79
@ mode
Definition: vtkX3D.h:253