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=========================================================================*/
44#ifndef vtkAnimationCue_h
45#define vtkAnimationCue_h
46
47#include "vtkCommonCoreModule.h" // For export macro
48#include "vtkObject.h"
49
50class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
51{
52public:
53 vtkTypeMacro(vtkAnimationCue, vtkObject);
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
57
58 // Structure passed on every event invocation.
59 // Depending upon the cue time mode, these times are either
60 // normalized [0,1] or relative to the scene that contains the cue.
61 // All this information is also available by asking the cue
62 // directly for it within the handler. Thus, this information can
63 // be accessed in wrapped languages.
65 {
66 public:
67 double StartTime;
68 double EndTime;
69 double AnimationTime; // valid only in AnimationCueTickEvent handler
70 double DeltaTime; // valid only in AnimationCueTickEvent handler
71 double ClockTime; // valid only in AnimationCueTickEvent handler
72 };
73
75
82 virtual void SetTimeMode(int mode);
83 vtkGetMacro(TimeMode, int);
84 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
85 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
87
89
99 vtkSetMacro(StartTime, double);
100 vtkGetMacro(StartTime, double);
102
104
113 vtkSetMacro(EndTime, double);
114 vtkGetMacro(EndTime, double);
116
135 virtual void Tick(double currenttime, double deltatime, double clocktime);
136
141 virtual void Initialize();
142
148 virtual void Finalize();
149
151
156 vtkGetMacro(AnimationTime, double);
158
160
165 vtkGetMacro(DeltaTime, double);
167
169
175 vtkGetMacro(ClockTime, double);
177
179 {
180 TIMEMODE_NORMALIZED = 0,
181 TIMEMODE_RELATIVE = 1
182 };
183
184protected:
187
188 enum
189 {
190 UNINITIALIZED = 0,
192 ACTIVE
193 };
194
195 double StartTime;
196 double EndTime;
198
199 // These are set when the AnimationCueTickEvent event
200 // is fired. Thus giving access to the information in
201 // the AnimationCueInfo struct in wrapped languages.
203 double DeltaTime;
204 double ClockTime;
205
210
212
217 virtual void StartCueInternal();
218 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
219 virtual void EndCueInternal();
221
222private:
223 vtkAnimationCue(const vtkAnimationCue&) = delete;
224 void operator=(const vtkAnimationCue&) = delete;
225};
226
227#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:34
abstract base class for most VTK objects
Definition: vtkObject.h:63