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=========================================================================*/
53#ifndef vtkAnimationCue_h
54#define vtkAnimationCue_h
55
56#include "vtkCommonCoreModule.h" // For export macro
57#include "vtkObject.h"
58
59class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
60{
61public:
62 vtkTypeMacro(vtkAnimationCue, vtkObject);
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
66
67 // Structure passed on every event invocation.
68 // Depending upon the cue time mode, these times are either
69 // normalized [0,1] or relative to the scene that contains the cue.
70 // All this information is also available by asking the cue
71 // directly for it within the handler. Thus, this information can
72 // be accessed in wrapped languages.
74 {
75 public:
76 double StartTime;
77 double EndTime;
78 double AnimationTime; // valid only in AnimationCueTickEvent handler
79 double DeltaTime; // valid only in AnimationCueTickEvent handler
80 double ClockTime; // valid only in AnimationCueTickEvent handler
81 };
82
84
91 virtual void SetTimeMode(int mode);
92 vtkGetMacro(TimeMode, int);
93 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
94 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
96
98
108 vtkSetMacro(StartTime, double);
109 vtkGetMacro(StartTime, double);
111
113
122 vtkSetMacro(EndTime, double);
123 vtkGetMacro(EndTime, double);
125
144 virtual void Tick(double currenttime, double deltatime, double clocktime);
145
150 virtual void Initialize();
151
157 virtual void Finalize();
158
160
165 vtkGetMacro(AnimationTime, double);
167
169
174 vtkGetMacro(DeltaTime, double);
176
178
184 vtkGetMacro(ClockTime, double);
186
188 {
189 TIMEMODE_NORMALIZED = 0,
190 TIMEMODE_RELATIVE = 1
191 };
192
193protected:
196
197 enum
198 {
199 UNINITIALIZED = 0,
201 ACTIVE
202 };
203
204 double StartTime;
205 double EndTime;
207
208 // These are set when the AnimationCueTickEvent event
209 // is fired. Thus giving access to the information in
210 // the AnimationCueInfo struct in wrapped languages.
212 double DeltaTime;
213 double ClockTime;
214
219
221
226 virtual void StartCueInternal();
227 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
228 virtual void EndCueInternal();
230
231private:
232 vtkAnimationCue(const vtkAnimationCue&) = delete;
233 void operator=(const vtkAnimationCue&) = delete;
234};
235
236#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:43
abstract base class for most VTK objects
Definition: vtkObject.h:72