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
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;
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);
71  void RemoveAllCues();
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 
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
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:29
Timer support and logging.
Definition: vtkTimerLog.h:85
@ mode
Definition: vtkX3D.h:247
@ time
Definition: vtkX3D.h:497