VTK  9.3.0
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
30 #ifndef vtkAnimationScene_h
31 #define vtkAnimationScene_h
32 
33 #include "vtkAnimationCue.h"
34 #include "vtkCommonDataModelModule.h" // For export macro
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkAnimationCue;
38 class vtkCollection;
40 class vtkTimerLog;
41 
42 class VTKCOMMONDATAMODEL_EXPORT vtkAnimationScene : public vtkAnimationCue
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
57  vtkSetMacro(PlayMode, int);
58  void SetModeToSequence() { this->SetPlayMode(PLAYMODE_SEQUENCE); }
59  void SetModeToRealTime() { this->SetPlayMode(PLAYMODE_REALTIME); }
60  vtkGetMacro(PlayMode, int);
62 
64 
69  vtkSetMacro(FrameRate, double);
70  vtkGetMacro(FrameRate, double);
72 
74 
78  void AddCue(vtkAnimationCue* cue);
80  void RemoveAllCues();
83 
88  virtual void Play();
89 
93  void Stop();
94 
96 
99  vtkSetMacro(Loop, int);
100  vtkGetMacro(Loop, int);
102 
106  void SetAnimationTime(double time);
107 
112  void SetTimeMode(int mode) override;
113 
117  int IsInPlay() { return this->InPlay; }
118 
120  {
121  PLAYMODE_SEQUENCE = 0,
122  PLAYMODE_REALTIME = 1
123  };
124 
125 protected:
127  ~vtkAnimationScene() override;
128 
130 
134  void TickInternal(double currenttime, double deltatime, double clocktime) override;
135  void StartCueInternal() override;
136  void EndCueInternal() override;
138 
141 
142  int PlayMode;
143  double FrameRate;
144  int Loop;
145  int InPlay;
146  int StopPlay;
147 
151 
152 private:
153  vtkAnimationScene(const vtkAnimationScene&) = delete;
154  void operator=(const vtkAnimationScene&) = delete;
155 };
156 
157 VTK_ABI_NAMESPACE_END
158 #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:38
Timer support and logging.
Definition: vtkTimerLog.h:94
@ mode
Definition: vtkX3D.h:247
@ time
Definition: vtkX3D.h:497