VTK  9.2.6
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 =========================================================================*/
53 #ifndef vtkAnimationCue_h
54 #define vtkAnimationCue_h
55 
56 #include "vtkCommonCoreModule.h" // For export macro
57 #include "vtkObject.h"
58 
59 class VTKCOMMONCORE_EXPORT vtkAnimationCue : public vtkObject
60 {
61 public:
62  vtkTypeMacro(vtkAnimationCue, vtkObject);
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
65  static vtkAnimationCue* New();
66 
67  // Structure passed on every event invocation.
68  // Depending upon the cue time mode, these times are either
69  // normalized [0,1] or relative to the scene that contains the cue.
70  // All this information is also available by asking the cue
71  // directly for it within the handler. Thus, this information can
72  // be accessed in wrapped languages.
74  {
75  public:
76  double StartTime;
77  double EndTime;
78  double AnimationTime; // valid only in AnimationCueTickEvent handler
79  double DeltaTime; // valid only in AnimationCueTickEvent handler
80  double ClockTime; // valid only in AnimationCueTickEvent handler
81  };
82 
84 
91  virtual void SetTimeMode(int mode);
92  vtkGetMacro(TimeMode, int);
93  void SetTimeModeToRelative() { this->SetTimeMode(TIMEMODE_RELATIVE); }
94  void SetTimeModeToNormalized() { this->SetTimeMode(TIMEMODE_NORMALIZED); }
96 
98 
108  vtkSetMacro(StartTime, double);
109  vtkGetMacro(StartTime, double);
111 
113 
122  vtkSetMacro(EndTime, double);
123  vtkGetMacro(EndTime, double);
125 
144  virtual void Tick(double currenttime, double deltatime, double clocktime);
145 
150  virtual void Initialize();
151 
157  virtual void Finalize();
158 
160 
165  vtkGetMacro(AnimationTime, double);
167 
169 
174  vtkGetMacro(DeltaTime, double);
176 
178 
184  vtkGetMacro(ClockTime, double);
186 
188  {
189  TIMEMODE_NORMALIZED = 0,
190  TIMEMODE_RELATIVE = 1
191  };
192 
193  enum class PlayDirection
194  {
195  BACKWARD,
196  FORWARD,
197  };
198 
200 
206 
207 protected:
209  ~vtkAnimationCue() override;
210 
211  enum
212  {
213  UNINITIALIZED = 0,
215  ACTIVE
216  };
217 
218  double StartTime;
219  double EndTime;
220  int TimeMode;
221  PlayDirection Direction = PlayDirection::FORWARD;
222 
223  // These are set when the AnimationCueTickEvent event
224  // is fired. Thus giving access to the information in
225  // the AnimationCueInfo struct in wrapped languages.
227  double DeltaTime;
228  double ClockTime;
229 
233  int CueState;
234 
236 
241  virtual void StartCueInternal();
242  virtual void TickInternal(double currenttime, double deltatime, double clocktime);
243  virtual void EndCueInternal();
245 
247 
251  virtual bool CheckStartCue(double currenttime);
252  virtual bool CheckEndCue(double currenttime);
254 
255 private:
256  vtkAnimationCue(const vtkAnimationCue&) = delete;
257  void operator=(const vtkAnimationCue&) = delete;
258 };
259 
260 #endif
a seqin an animation.
static vtkAnimationCue * New()
~vtkAnimationCue() override
void SetTimeModeToRelative()
Get/Set the time mode.
void SetTimeModeToNormalized()
Get/Set the time mode.
virtual void StartCueInternal()
These are the internal methods that actually trigger they corresponding events.
virtual void EndCueInternal()
These are the internal methods that actually trigger they corresponding events.
virtual bool CheckEndCue(double currenttime)
These test the start, end time variables with current time to decide whether the animation can begin ...
virtual void Initialize()
Called when the playing of the scene begins.
virtual void Finalize()
Called when the scene reaches the end.
vtkSetEnumMacro(Direction, PlayDirection)
Set/get the direction of playback.
virtual bool CheckStartCue(double currenttime)
These test the start, end time variables with current time to decide whether the animation can begin ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int CueState
Current state of the Cue.
virtual void TickInternal(double currenttime, double deltatime, double clocktime)
These are the internal methods that actually trigger they corresponding events.
virtual void SetTimeMode(int mode)
Get/Set the time mode.
virtual void Tick(double currenttime, double deltatime, double clocktime)
Indicates a tick or point in time in the animation.
vtkGetEnumMacro(Direction, PlayDirection)
Set/get the direction of playback.
a simple class to control print indentation
Definition: vtkIndent.h:49
abstract base class for most VTK objects
Definition: vtkObject.h:72
@ mode
Definition: vtkX3D.h:253