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 =========================================================================*/
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);
79  { this->SetTimeMode(TIMEMODE_RELATIVE); }
81  { this->SetTimeMode(TIMEMODE_NORMALIZED); }
83 
85 
95  vtkSetMacro(StartTime, double);
96  vtkGetMacro(StartTime, double);
98 
100 
109  vtkSetMacro(EndTime, double);
110  vtkGetMacro(EndTime, double);
112 
131  virtual void Tick(double currenttime, double deltatime, double clocktime);
132 
137  virtual void Initialize();
138 
144  virtual void Finalize();
145 
147 
152  vtkGetMacro(AnimationTime, double);
154 
156 
161  vtkGetMacro(DeltaTime, double);
163 
165 
171  vtkGetMacro(ClockTime, double);
173 
175  {
176  TIMEMODE_NORMALIZED=0,
177  TIMEMODE_RELATIVE=1
178  };
179 
180 protected:
181  vtkAnimationCue();
182  ~vtkAnimationCue() override;
183 
184  enum {
185  UNINITIALIZED=0,
187  ACTIVE
188  };
189 
190  double StartTime;
191  double EndTime;
192  int TimeMode;
193 
194  // These are set when the AnimationCueTickEvent event
195  // is fired. Thus giving access to the information in
196  // the AnimationCueInfo struct in wrapped languages.
198  double DeltaTime;
199  double ClockTime;
200 
204  int CueState;
205 
207 
212  virtual void StartCueInternal();
213  virtual void TickInternal(double currenttime, double deltatime,
214  double clocktime);
215  virtual void EndCueInternal();
217 
218 private:
219  vtkAnimationCue(const vtkAnimationCue&) = delete;
220  void operator=(const vtkAnimationCue&) = delete;
221 };
222 
223 #endif
224 
225 
226 
void SetTimeModeToNormalized()
Get/Set the time mode.
abstract base class for most VTK objects
Definition: vtkObject.h:53
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.