VTK  9.0.1
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 
44 class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
45 {
46 public:
47  vtkTypeMacro(vtkAnimationCue, vtkObject);
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
50  static vtkAnimationCue* New();
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 
178 protected:
180  ~vtkAnimationCue() override;
181 
182  enum
183  {
184  UNINITIALIZED = 0,
186  ACTIVE
187  };
188 
189  double StartTime;
190  double EndTime;
191  int TimeMode;
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 
203  int CueState;
204 
206 
211  virtual void StartCueInternal();
212  virtual void TickInternal(double currenttime, double deltatime, double clocktime);
213  virtual void EndCueInternal();
215 
216 private:
217  vtkAnimationCue(const vtkAnimationCue&) = delete;
218  void operator=(const vtkAnimationCue&) = delete;
219 };
220 
221 #endif
vtkAnimationCue::StartCueInternal
virtual void StartCueInternal()
These are the internal methods that actually trigger they corresponding events.
vtkAnimationCue::Finalize
virtual void Finalize()
Called when the scene reaches the end.
vtkAnimationCue::INACTIVE
@ INACTIVE
Definition: vtkAnimationCue.h:185
vtkAnimationCue::SetTimeModeToRelative
void SetTimeModeToRelative()
Definition: vtkAnimationCue.h:78
vtkAnimationCue::AnimationCueInfo::AnimationTime
double AnimationTime
Definition: vtkAnimationCue.h:63
vtkAnimationCue::SetTimeMode
virtual void SetTimeMode(int mode)
Get/Set the time mode.
vtkAnimationCue::TimeCodes
TimeCodes
Definition: vtkAnimationCue.h:173
vtkAnimationCue::StartTime
double StartTime
Definition: vtkAnimationCue.h:189
vtkAnimationCue::Tick
virtual void Tick(double currenttime, double deltatime, double clocktime)
Indicates a tick or point in time in the animation.
vtkAnimationCue::AnimationCueInfo::EndTime
double EndTime
Definition: vtkAnimationCue.h:62
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkAnimationCue::AnimationCueInfo::ClockTime
double ClockTime
Definition: vtkAnimationCue.h:65
vtkAnimationCue::vtkAnimationCue
vtkAnimationCue()
vtkAnimationCue::CueState
int CueState
Current state of the Cue.
Definition: vtkAnimationCue.h:203
vtkAnimationCue::EndCueInternal
virtual void EndCueInternal()
vtkAnimationCue::AnimationTime
double AnimationTime
Definition: vtkAnimationCue.h:196
vtkAnimationCue
a seqin an animation.
Definition: vtkAnimationCue.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkAnimationCue::AnimationCueInfo::DeltaTime
double DeltaTime
Definition: vtkAnimationCue.h:64
vtkAnimationCue::~vtkAnimationCue
~vtkAnimationCue() override
vtkAnimationCue::TickInternal
virtual void TickInternal(double currenttime, double deltatime, double clocktime)
vtkAnimationCue::SetTimeModeToNormalized
void SetTimeModeToNormalized()
Definition: vtkAnimationCue.h:79
vtkAnimationCue::AnimationCueInfo
Definition: vtkAnimationCue.h:59
vtkAnimationCue::New
static vtkAnimationCue * New()
vtkObject.h
vtkAnimationCue::EndTime
double EndTime
Definition: vtkAnimationCue.h:190
vtkAnimationCue::ClockTime
double ClockTime
Definition: vtkAnimationCue.h:198
vtkAnimationCue::Initialize
virtual void Initialize()
Called when the playing of the scene begins.
vtkX3D::mode
@ mode
Definition: vtkX3D.h:253
vtkAnimationCue::AnimationCueInfo::StartTime
double StartTime
Definition: vtkAnimationCue.h:61
vtkAnimationCue::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAnimationCue::DeltaTime
double DeltaTime
Definition: vtkAnimationCue.h:197
vtkAnimationCue::TimeMode
int TimeMode
Definition: vtkAnimationCue.h:191