VTK  9.3.1
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
21 #ifndef vtkAnimationScene_h
22 #define vtkAnimationScene_h
23 
24 #include "vtkAnimationCue.h"
25 #include "vtkCommonDataModelModule.h" // For export macro
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkAnimationCue;
29 class vtkCollection;
31 class vtkTimerLog;
32 
33 class VTKCOMMONDATAMODEL_EXPORT vtkAnimationScene : public vtkAnimationCue
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38  static vtkAnimationScene* New();
39 
41 
48  vtkSetMacro(PlayMode, int);
49  void SetModeToSequence() { this->SetPlayMode(PLAYMODE_SEQUENCE); }
50  void SetModeToRealTime() { this->SetPlayMode(PLAYMODE_REALTIME); }
51  vtkGetMacro(PlayMode, int);
53 
55 
60  vtkSetMacro(FrameRate, double);
61  vtkGetMacro(FrameRate, double);
63 
65 
69  void AddCue(vtkAnimationCue* cue);
70  void RemoveCue(vtkAnimationCue* cue);
71  void RemoveAllCues();
72  int GetNumberOfCues();
74 
79  virtual void Play();
80 
84  void Stop();
85 
87 
90  vtkSetMacro(Loop, int);
91  vtkGetMacro(Loop, int);
93 
97  void SetAnimationTime(double time);
98 
103  void SetTimeMode(int mode) override;
104 
108  int IsInPlay() { return this->InPlay; }
109 
111  {
112  PLAYMODE_SEQUENCE = 0,
113  PLAYMODE_REALTIME = 1
114  };
115 
116 protected:
118  ~vtkAnimationScene() override;
119 
121 
125  void TickInternal(double currenttime, double deltatime, double clocktime) override;
126  void StartCueInternal() override;
127  void EndCueInternal() override;
129 
130  void InitializeChildren();
131  void FinalizeChildren();
132 
133  int PlayMode;
134  double FrameRate;
135  int Loop;
136  int InPlay;
137  int StopPlay;
138 
142 
143 private:
144  vtkAnimationScene(const vtkAnimationScene&) = delete;
145  void operator=(const vtkAnimationScene&) = delete;
146 };
147 
148 VTK_ABI_NAMESPACE_END
149 #endif
virtual void EndCueInternal()
These are the internal methods that actually trigger they corresponding events.
static vtkAnimationCue * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetModeToSequence()
Get/Set the PlayMode for running/playing the animation scene.
Timer support and logging.
Definition: vtkTimerLog.h:84
vtkTimerLog * AnimationTimer
virtual void TickInternal(double currenttime, double deltatime, double clocktime)
These are the internal methods that actually trigger they corresponding events.
virtual void StartCueInternal()
These are the internal methods that actually trigger they corresponding events.
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkCollection * AnimationCues
int IsInPlay()
Returns if the animation is being played.
a seqin an animation.
virtual void SetTimeMode(int mode)
Get/Set the time mode.
void SetModeToRealTime()
Get/Set the PlayMode for running/playing the animation scene.
iterator through a vtkCollection.
the animation scene manager.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:44
vtkCollectionIterator * AnimationCuesIterator