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 =========================================================================*/
73 #ifndef vtkAnimationCue_h
74 #define vtkAnimationCue_h
75 
76 #include "vtkCommonCoreModule.h" // For export macro
77 #include "vtkObject.h"
78 
79 class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
80 {
81 public:
82  vtkTypeMacro(vtkAnimationCue, vtkObject);
83  void PrintSelf(ostream& os, vtkIndent indent) override;
84 
85  static vtkAnimationCue* New();
86 
87  // Structure passed on every event invocation.
88  // Depending upon the cue time mode, these times are either
89  // normalized [0,1] or relative to the scene that contains the cue.
90  // All this information is also available by asking the cue
91  // directly for it within the handler. Thus, this information can
92  // be accessed in wrapped languages.
94  {
95  public:
96  double StartTime;
97  double EndTime;
98  double AnimationTime; // valid only in AnimationCueTickEvent handler
99  double DeltaTime; // valid only in AnimationCueTickEvent handler
100  double ClockTime; // valid only in AnimationCueTickEvent handler
101  };
102 
104 
111  virtual void SetTimeMode(int mode);
112  vtkGetMacro(TimeMode, int);
113  void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
114  void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
116 
118 
128  vtkSetMacro(StartTime, double);
129  vtkGetMacro(StartTime, double);
131 
133 
142  vtkSetMacro(EndTime, double);
143  vtkGetMacro(EndTime, double);
145 
164  virtual void Tick(double currenttime, double deltatime, double clocktime);
165 
170  virtual void Initialize();
171 
177  virtual void Finalize();
178 
180 
185  vtkGetMacro(AnimationTime, double);
187 
189 
194  vtkGetMacro(DeltaTime, double);
196 
198 
204  vtkGetMacro(ClockTime, double);
206 
208  {
209  TIMEMODE_NORMALIZED = 0,
210  TIMEMODE_RELATIVE = 1
211  };
212 
213 protected:
215  ~vtkAnimationCue() override;
216 
217  enum
218  {
219  UNINITIALIZED = 0,
221  ACTIVE
222  };
223 
224  double StartTime;
225  double EndTime;
226  int TimeMode;
227 
228  // These are set when the AnimationCueTickEvent event
229  // is fired. Thus giving access to the information in
230  // the AnimationCueInfo struct in wrapped languages.
232  double DeltaTime;
233  double ClockTime;
234 
238  int CueState;
239 
241 
246  virtual void StartCueInternal();
247  virtual void TickInternal(double currenttime, double deltatime, double clocktime);
248  virtual void EndCueInternal();
250 
251 private:
252  vtkAnimationCue(const vtkAnimationCue&) = delete;
253  void operator=(const vtkAnimationCue&) = delete;
254 };
255 
256 #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::SetTimeModeToRelative
void SetTimeModeToRelative()
Get/Set the time mode.
Definition: vtkAnimationCue.h:113
vtkAnimationCue::AnimationCueInfo::AnimationTime
double AnimationTime
Definition: vtkAnimationCue.h:98
vtkAnimationCue::SetTimeMode
virtual void SetTimeMode(int mode)
Get/Set the time mode.
vtkAnimationCue::TimeCodes
TimeCodes
Definition: vtkAnimationCue.h:208
vtkAnimationCue::StartTime
double StartTime
Definition: vtkAnimationCue.h:224
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:97
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkAnimationCue::AnimationCueInfo::ClockTime
double ClockTime
Definition: vtkAnimationCue.h:100
vtkAnimationCue::vtkAnimationCue
vtkAnimationCue()
vtkAnimationCue::INACTIVE
@ INACTIVE
Definition: vtkAnimationCue.h:220
vtkAnimationCue::CueState
int CueState
Current state of the Cue.
Definition: vtkAnimationCue.h:238
vtkAnimationCue::EndCueInternal
virtual void EndCueInternal()
These are the internal methods that actually trigger they corresponding events.
vtkAnimationCue::AnimationTime
double AnimationTime
Definition: vtkAnimationCue.h:231
vtkAnimationCue
a seqin an animation.
Definition: vtkAnimationCue.h:80
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkAnimationCue::AnimationCueInfo::DeltaTime
double DeltaTime
Definition: vtkAnimationCue.h:99
vtkAnimationCue::~vtkAnimationCue
~vtkAnimationCue() override
vtkAnimationCue::TickInternal
virtual void TickInternal(double currenttime, double deltatime, double clocktime)
These are the internal methods that actually trigger they corresponding events.
vtkAnimationCue::SetTimeModeToNormalized
void SetTimeModeToNormalized()
Get/Set the time mode.
Definition: vtkAnimationCue.h:114
vtkAnimationCue::AnimationCueInfo
Definition: vtkAnimationCue.h:94
vtkAnimationCue::New
static vtkAnimationCue * New()
vtkObject.h
vtkAnimationCue::EndTime
double EndTime
Definition: vtkAnimationCue.h:225
vtkAnimationCue::ClockTime
double ClockTime
Definition: vtkAnimationCue.h:233
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:96
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:232
vtkAnimationCue::TimeMode
int TimeMode
Definition: vtkAnimationCue.h:226