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=========================================================================*/
38#ifndef vtkAnimationCue_h
39#define vtkAnimationCue_h
40
41#include "vtkCommonCoreModule.h" // For export macro
42#include "vtkObject.h"
43
44class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
45{
46public:
47 vtkTypeMacro(vtkAnimationCue, vtkObject);
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51
52 // Structure passed on every event invocation.
53 // Depending upon the cue time mode, these times are either
54 // normalized [0,1] or relative to the scene that contains the cue.
55 // All this information is also available by asking the cue
56 // directly for it within the handler. Thus, this information can
57 // be accessed in wrapped languages.
59 {
60 public:
61 double StartTime;
62 double EndTime;
63 double AnimationTime; // valid only in AnimationCueTickEvent handler
64 double DeltaTime; // valid only in AnimationCueTickEvent handler
65 double ClockTime; // valid only in AnimationCueTickEvent handler
66 };
67
69
76 virtual void SetTimeMode(int mode);
77 vtkGetMacro(TimeMode, int);
78 void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
79 void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
81
83
93 vtkSetMacro(StartTime, double);
94 vtkGetMacro(StartTime, double);
96
98
107 vtkSetMacro(EndTime, double);
108 vtkGetMacro(EndTime, double);
110
129 virtual void Tick(double currenttime, double deltatime, double clocktime);
130
135 virtual void Initialize();
136
142 virtual void Finalize();
143
145
150 vtkGetMacro(AnimationTime, double);
152
154
159 vtkGetMacro(DeltaTime, double);
161
163
169 vtkGetMacro(ClockTime, double);
171
173 {
174 TIMEMODE_NORMALIZED = 0,
175 TIMEMODE_RELATIVE = 1
176 };
177
178protected:
181
182 enum
183 {
184 UNINITIALIZED = 0,
186 ACTIVE
187 };
188
189 double StartTime;
190 double EndTime;
192
193 // These are set when the AnimationCueTickEvent event
194 // is fired. Thus giving access to the information in
195 // the AnimationCueInfo struct in wrapped languages.
197 double DeltaTime;
198 double ClockTime;
199
204
206
211 virtual void StartCueInternal();
212 virtual void TickInternal(double currenttime, double deltatime, double clocktime);
213 virtual void EndCueInternal();
215
216private:
217 vtkAnimationCue(const vtkAnimationCue&) = delete;
218 void operator=(const vtkAnimationCue&) = delete;
219};
220
221#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:54