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=========================================================================*/
67#ifndef vtkAnimationCue_h
68#define vtkAnimationCue_h
69
70#include "vtkCommonCoreModule.h" // For export macro
71#include "vtkObject.h"
72
73class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
74{
75public:
76 vtkTypeMacro(vtkAnimationCue, vtkObject);
77 void PrintSelf(ostream& os, vtkIndent indent) override;
78
80
81 // Structure passed on every event invocation.
82 // Depending upon the cue time mode, these times are either
83 // normalized [0,1] or relative to the scene that contains the cue.
84 // All this information is also available by asking the cue
85 // directly for it within the handler. Thus, this information can
86 // be accessed in wrapped languages.
88 {
89 public:
90 double StartTime;
91 double EndTime;
92 double AnimationTime; // valid only in AnimationCueTickEvent handler
93 double DeltaTime; // valid only in AnimationCueTickEvent handler
94 double ClockTime; // valid only in AnimationCueTickEvent handler
95 };
96
98
105 virtual void SetTimeMode(int mode);
106 vtkGetMacro(TimeMode, int);
107 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
108 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
110
112
122 vtkSetMacro(StartTime, double);
123 vtkGetMacro(StartTime, double);
125
127
136 vtkSetMacro(EndTime, double);
137 vtkGetMacro(EndTime, double);
139
158 virtual void Tick(double currenttime, double deltatime, double clocktime);
159
164 virtual void Initialize();
165
171 virtual void Finalize();
172
174
179 vtkGetMacro(AnimationTime, double);
181
183
188 vtkGetMacro(DeltaTime, double);
190
192
198 vtkGetMacro(ClockTime, double);
200
202 {
203 TIMEMODE_NORMALIZED = 0,
204 TIMEMODE_RELATIVE = 1
205 };
206
207protected:
210
211 enum
212 {
213 UNINITIALIZED = 0,
215 ACTIVE
216 };
217
218 double StartTime;
219 double EndTime;
221
222 // These are set when the AnimationCueTickEvent event
223 // is fired. Thus giving access to the information in
224 // the AnimationCueInfo struct in wrapped languages.
226 double DeltaTime;
227 double ClockTime;
228
233
235
240 virtual void StartCueInternal();
241 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
242 virtual void EndCueInternal();
244
245private:
246 vtkAnimationCue(const vtkAnimationCue&) = delete;
247 void operator=(const vtkAnimationCue&) = delete;
248};
249
250#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:73
@ mode
Definition: vtkX3D.h:253