VTK  9.7.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;
30 class vtkTimerLog;
31 
32 class VTKCOMMONDATAMODEL_EXPORT vtkAnimationScene : public vtkAnimationCue
33 {
34 public:
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37  static vtkAnimationScene* New();
38 
40 
47  vtkSetMacro(PlayMode, int);
48  void SetModeToSequence() { this->SetPlayMode(PLAYMODE_SEQUENCE); }
49  void SetModeToRealTime() { this->SetPlayMode(PLAYMODE_REALTIME); }
50  vtkGetMacro(PlayMode, int);
52 
54 
59  vtkSetMacro(FrameRate, double);
60  vtkGetMacro(FrameRate, double);
62 
64 
68  void AddCue(vtkAnimationCue* cue);
69  void RemoveCue(vtkAnimationCue* cue);
70  void RemoveAllCues();
71  int GetNumberOfCues();
73 
78  virtual void Play();
79 
83  void Stop();
84 
86 
89  vtkSetMacro(Loop, int);
90  vtkGetMacro(Loop, int);
92 
96  void SetAnimationTime(double time);
97 
102  void SetTimeMode(int mode) override;
103 
107  int IsInPlay() { return this->InPlay; }
108 
110  {
111  PLAYMODE_SEQUENCE = 0,
112  PLAYMODE_REALTIME = 1
113  };
114 
115 protected:
117  ~vtkAnimationScene() override;
118 
120 
124  void TickInternal(double currenttime, double deltatime, double clocktime) override;
125  void StartCueInternal() override;
126  void EndCueInternal() override;
128 
129  void InitializeChildren();
130  void FinalizeChildren();
131 
132  int PlayMode;
133  double FrameRate;
134  int Loop;
135  int InPlay;
136  int StopPlay;
137 
140 
141 private:
142  vtkAnimationScene(const vtkAnimationScene&) = delete;
143  void operator=(const vtkAnimationScene&) = delete;
144 };
145 
146 VTK_ABI_NAMESPACE_END
147 #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:85
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.
the animation scene manager.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:39