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 =========================================================================*/
44 #ifndef vtkAnimationCue_h
45 #define vtkAnimationCue_h
46 
47 #include "vtkCommonCoreModule.h" // For export macro
48 #include "vtkObject.h"
49 
50 class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
51 {
52 public:
53  vtkTypeMacro(vtkAnimationCue, vtkObject);
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
56  static vtkAnimationCue* New();
57 
58  // Structure passed on every event invocation.
59  // Depending upon the cue time mode, these times are either
60  // normalized [0,1] or relative to the scene that contains the cue.
61  // All this information is also available by asking the cue
62  // directly for it within the handler. Thus, this information can
63  // be accessed in wrapped languages.
65  {
66  public:
67  double StartTime;
68  double EndTime;
69  double AnimationTime; // valid only in AnimationCueTickEvent handler
70  double DeltaTime; // valid only in AnimationCueTickEvent handler
71  double ClockTime; // valid only in AnimationCueTickEvent handler
72  };
73 
75 
82  virtual void SetTimeMode(int mode);
83  vtkGetMacro(TimeMode, int);
84  void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
85  void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
87 
89 
99  vtkSetMacro(StartTime, double);
100  vtkGetMacro(StartTime, double);
102 
104 
113  vtkSetMacro(EndTime, double);
114  vtkGetMacro(EndTime, double);
116 
135  virtual void Tick(double currenttime, double deltatime, double clocktime);
136 
141  virtual void Initialize();
142 
148  virtual void Finalize();
149 
151 
156  vtkGetMacro(AnimationTime, double);
158 
160 
165  vtkGetMacro(DeltaTime, double);
167 
169 
175  vtkGetMacro(ClockTime, double);
177 
179  {
180  TIMEMODE_NORMALIZED = 0,
181  TIMEMODE_RELATIVE = 1
182  };
183 
184 protected:
185  vtkAnimationCue();
186  ~vtkAnimationCue() override;
187 
188  enum
189  {
190  UNINITIALIZED = 0,
192  ACTIVE
193  };
194 
195  double StartTime;
196  double EndTime;
197  int TimeMode;
198 
199  // These are set when the AnimationCueTickEvent event
200  // is fired. Thus giving access to the information in
201  // the AnimationCueInfo struct in wrapped languages.
203  double DeltaTime;
204  double ClockTime;
205 
209  int CueState;
210 
212 
217  virtual void StartCueInternal();
218  virtual void TickInternal(double currenttime, double deltatime, double clocktime);
219  virtual void EndCueInternal();
221 
222 private:
223  vtkAnimationCue(const vtkAnimationCue&) = delete;
224  void operator=(const vtkAnimationCue&) = delete;
225 };
226 
227 #endif
void SetTimeModeToNormalized()
Get/Set the time mode.
abstract base class for most VTK objects
Definition: vtkObject.h:62
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...