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 =========================================================================*/
41 #ifndef vtkAnimationCue_h
42 #define vtkAnimationCue_h
43 
44 #include "vtkCommonCoreModule.h" // For export macro
45 #include "vtkObject.h"
46 
47 class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
48 {
49 public:
50  vtkTypeMacro(vtkAnimationCue, vtkObject);
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
53  static vtkAnimationCue* New();
54 
55  // Structure passed on every event invocation.
56  // Depending upon the cue time mode, these times are either
57  // normalized [0,1] or relative to the scene that contains the cue.
58  // All this information is also available by asking the cue
59  // directly for it within the handler. Thus, this information can
60  // be accessed in wrapped languages.
62  {
63  public:
64  double StartTime;
65  double EndTime;
66  double AnimationTime; // valid only in AnimationCueTickEvent handler
67  double DeltaTime; // valid only in AnimationCueTickEvent handler
68  double ClockTime; // valid only in AnimationCueTickEvent handler
69  };
70 
72 
79  virtual void SetTimeMode(int mode);
80  vtkGetMacro(TimeMode, int);
81  void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
82  void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
84 
86 
96  vtkSetMacro(StartTime, double);
97  vtkGetMacro(StartTime, double);
99 
101 
110  vtkSetMacro(EndTime, double);
111  vtkGetMacro(EndTime, double);
113 
132  virtual void Tick(double currenttime, double deltatime, double clocktime);
133 
138  virtual void Initialize();
139 
145  virtual void Finalize();
146 
148 
153  vtkGetMacro(AnimationTime, double);
155 
157 
162  vtkGetMacro(DeltaTime, double);
164 
166 
172  vtkGetMacro(ClockTime, double);
174 
176  {
177  TIMEMODE_NORMALIZED = 0,
178  TIMEMODE_RELATIVE = 1
179  };
180 
181 protected:
182  vtkAnimationCue();
183  ~vtkAnimationCue() override;
184 
185  enum
186  {
187  UNINITIALIZED = 0,
189  ACTIVE
190  };
191 
192  double StartTime;
193  double EndTime;
194  int TimeMode;
195 
196  // These are set when the AnimationCueTickEvent event
197  // is fired. Thus giving access to the information in
198  // the AnimationCueInfo struct in wrapped languages.
200  double DeltaTime;
201  double ClockTime;
202 
206  int CueState;
207 
209 
214  virtual void StartCueInternal();
215  virtual void TickInternal(double currenttime, double deltatime, double clocktime);
216  virtual void EndCueInternal();
218 
219 private:
220  vtkAnimationCue(const vtkAnimationCue&) = delete;
221  void operator=(const vtkAnimationCue&) = delete;
222 };
223 
224 #endif
void SetTimeModeToNormalized()
Get/Set the time mode.
abstract base class for most VTK objects
Definition: vtkObject.h:56
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
a seqin an animation.
int CueState
Current state of the Cue.
void SetTimeModeToRelative()
Get/Set the time mode.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...