VTK  9.3.20240327
vtkAnimationScene.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
50 #ifndef vtkAnimationScene_h
51 #define vtkAnimationScene_h
52 
53 #include "vtkAnimationCue.h"
54 #include "vtkCommonDataModelModule.h" // For export macro
55 
56 VTK_ABI_NAMESPACE_BEGIN
57 class vtkAnimationCue;
58 class vtkCollection;
60 class vtkTimerLog;
61 
62 class VTKCOMMONDATAMODEL_EXPORT vtkAnimationScene : public vtkAnimationCue
63 {
64 public:
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
70 
77  vtkSetMacro(PlayMode, int);
78  void SetModeToSequence() { this->SetPlayMode(PLAYMODE_SEQUENCE); }
79  void SetModeToRealTime() { this->SetPlayMode(PLAYMODE_REALTIME); }
80  vtkGetMacro(PlayMode, int);
82 
84 
89  vtkSetMacro(FrameRate, double);
90  vtkGetMacro(FrameRate, double);
92 
94 
98  void AddCue(vtkAnimationCue* cue);
103 
108  virtual void Play();
109 
113  void Stop();
114 
116 
119  vtkSetMacro(Loop, int);
120  vtkGetMacro(Loop, int);
122 
126  void SetAnimationTime(double time);
127 
132  void SetTimeMode(int mode) override;
133 
137  int IsInPlay() { return this->InPlay; }
138 
140  {
141  PLAYMODE_SEQUENCE = 0,
142  PLAYMODE_REALTIME = 1
143  };
144 
145 protected:
147  ~vtkAnimationScene() override;
148 
150 
154  void TickInternal(double currenttime, double deltatime, double clocktime) override;
155  void StartCueInternal() override;
156  void EndCueInternal() override;
158 
161 
162  int PlayMode;
163  double FrameRate;
164  int Loop;
165  int InPlay;
166  int StopPlay;
167 
171 
172 private:
173  vtkAnimationScene(const vtkAnimationScene&) = delete;
174  void operator=(const vtkAnimationScene&) = delete;
175 };
176 
177 VTK_ABI_NAMESPACE_END
178 #endif
a seqin an animation.
the animation scene manager.
void SetModeToSequence()
Get/Set the PlayMode for running/playing the animation scene.
void SetAnimationTime(double time)
Makes the state of the scene same as the given time.
void TickInternal(double currenttime, double deltatime, double clocktime) override
Called on every valid tick.
int IsInPlay()
Returns if the animation is being played.
void RemoveCue(vtkAnimationCue *cue)
Add/Remove an AnimationCue to/from the Scene.
void StartCueInternal() override
Called on every valid tick.
void EndCueInternal() override
Called on every valid tick.
~vtkAnimationScene() override
void InitializeChildren()
int GetNumberOfCues()
Add/Remove an AnimationCue to/from the Scene.
static vtkAnimationScene * New()
void AddCue(vtkAnimationCue *cue)
Add/Remove an AnimationCue to/from the Scene.
void RemoveAllCues()
Add/Remove an AnimationCue to/from the Scene.
vtkTimerLog * AnimationTimer
void SetModeToRealTime()
Get/Set the PlayMode for running/playing the animation scene.
void SetTimeMode(int mode) override
Overridden to allow change to Normalized mode only if none of the constituent cues is in Relative tim...
void Stop()
Stops the animation scene that is running.
vtkCollection * AnimationCues
virtual void Play()
Starts playing the animation scene.
vtkCollectionIterator * AnimationCuesIterator
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
iterator through a vtkCollection.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
a simple class to control print indentation
Definition: vtkIndent.h:108
Timer support and logging.
Definition: vtkTimerLog.h:174
@ mode
Definition: vtkX3D.h:247
@ time
Definition: vtkX3D.h:497