VTK  9.1.0
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
213protected:
216
217 enum
218 {
219 UNINITIALIZED = 0,
221 ACTIVE
222 };
223
224 double StartTime;
225 double EndTime;
227
228 // These are set when the AnimationCueTickEvent event
229 // is fired. Thus giving access to the information in
230 // the AnimationCueInfo struct in wrapped languages.
232 double DeltaTime;
233 double ClockTime;
234
239
241
246 virtual void StartCueInternal();
247 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
248 virtual void EndCueInternal();
250
251private:
252 vtkAnimationCue(const vtkAnimationCue&) = delete;
253 void operator=(const vtkAnimationCue&) = delete;
254};
255
256#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 void Initialize()
Called when the playing of the scene begins.
virtual void Finalize()
Called when the scene reaches the end.
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.
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82