VTK
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);
82  { this->SetTimeMode(TIMEMODE_RELATIVE); }
84  { this->SetTimeMode(TIMEMODE_NORMALIZED); }
86 
88 
98  vtkSetMacro(StartTime, double);
99  vtkGetMacro(StartTime, double);
101 
103 
112  vtkSetMacro(EndTime, double);
113  vtkGetMacro(EndTime, double);
115 
134  virtual void Tick(double currenttime, double deltatime, double clocktime);
135 
140  virtual void Initialize();
141 
147  virtual void Finalize();
148 
150 
155  vtkGetMacro(AnimationTime, double);
157 
159 
164  vtkGetMacro(DeltaTime, double);
166 
168 
174  vtkGetMacro(ClockTime, double);
176 
178  {
179  TIMEMODE_NORMALIZED=0,
180  TIMEMODE_RELATIVE=1
181  };
182 
183 protected:
184  vtkAnimationCue();
185  ~vtkAnimationCue() override;
186 
187  enum {
188  UNINITIALIZED=0,
190  ACTIVE
191  };
192 
193  double StartTime;
194  double EndTime;
195  int TimeMode;
196 
197  // These are set when the AnimationCueTickEvent event
198  // is fired. Thus giving access to the information in
199  // the AnimationCueInfo struct in wrapped languages.
201  double DeltaTime;
202  double ClockTime;
203 
207  int CueState;
208 
210 
215  virtual void StartCueInternal();
216  virtual void TickInternal(double currenttime, double deltatime,
217  double clocktime);
218  virtual void EndCueInternal();
220 
221 private:
222  vtkAnimationCue(const vtkAnimationCue&) = delete;
223  void operator=(const vtkAnimationCue&) = delete;
224 };
225 
226 #endif
227 
228 
229 
void SetTimeModeToNormalized()
Get/Set the time mode.
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:39
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...