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=========================================================================*/
47#ifndef vtkAnimationCue_h
48#define vtkAnimationCue_h
49
50#include "vtkCommonCoreModule.h" // For export macro
51#include "vtkObject.h"
52
53class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
54{
55public:
56 vtkTypeMacro(vtkAnimationCue, vtkObject);
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
60
61 // Structure passed on every event invocation.
62 // Depending upon the cue time mode, these times are either
63 // normalized [0,1] or relative to the scene that contains the cue.
64 // All this information is also available by asking the cue
65 // directly for it within the handler. Thus, this information can
66 // be accessed in wrapped languages.
68 {
69 public:
70 double StartTime;
71 double EndTime;
72 double AnimationTime; // valid only in AnimationCueTickEvent handler
73 double DeltaTime; // valid only in AnimationCueTickEvent handler
74 double ClockTime; // valid only in AnimationCueTickEvent handler
75 };
76
78
85 virtual void SetTimeMode(int mode);
86 vtkGetMacro(TimeMode, int);
87 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
88 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
90
92
102 vtkSetMacro(StartTime, double);
103 vtkGetMacro(StartTime, double);
105
107
116 vtkSetMacro(EndTime, double);
117 vtkGetMacro(EndTime, double);
119
138 virtual void Tick(double currenttime, double deltatime, double clocktime);
139
144 virtual void Initialize();
145
151 virtual void Finalize();
152
154
159 vtkGetMacro(AnimationTime, double);
161
163
168 vtkGetMacro(DeltaTime, double);
170
172
178 vtkGetMacro(ClockTime, double);
180
182 {
183 TIMEMODE_NORMALIZED = 0,
184 TIMEMODE_RELATIVE = 1
185 };
186
187protected:
190
191 enum
192 {
193 UNINITIALIZED = 0,
195 ACTIVE
196 };
197
198 double StartTime;
199 double EndTime;
201
202 // These are set when the AnimationCueTickEvent event
203 // is fired. Thus giving access to the information in
204 // the AnimationCueInfo struct in wrapped languages.
206 double DeltaTime;
207 double ClockTime;
208
213
215
220 virtual void StartCueInternal();
221 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
222 virtual void EndCueInternal();
224
225private:
226 vtkAnimationCue(const vtkAnimationCue&) = delete;
227 void operator=(const vtkAnimationCue&) = delete;
228};
229
230#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:63
@ mode
Definition: vtkX3D.h:253