VTK  9.0.1
vtkAnimationScene.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAnimationScene.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
30 #ifndef vtkAnimationScene_h
31 #define vtkAnimationScene_h
32 
33 #include "vtkAnimationCue.h"
34 #include "vtkCommonDataModelModule.h" // For export macro
35 
36 class vtkAnimationCue;
37 class vtkCollection;
39 class vtkTimerLog;
40 
41 class VTKCOMMONDATAMODEL_EXPORT vtkAnimationScene : public vtkAnimationCue
42 {
43 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
56  vtkSetMacro(PlayMode, int);
57  void SetModeToSequence() { this->SetPlayMode(PLAYMODE_SEQUENCE); }
58  void SetModeToRealTime() { this->SetPlayMode(PLAYMODE_REALTIME); }
59  vtkGetMacro(PlayMode, int);
61 
63 
68  vtkSetMacro(FrameRate, double);
69  vtkGetMacro(FrameRate, double);
71 
73 
77  void AddCue(vtkAnimationCue* cue);
79  void RemoveAllCues();
82 
87  virtual void Play();
88 
92  void Stop();
93 
95 
98  vtkSetMacro(Loop, int);
99  vtkGetMacro(Loop, int);
101 
105  void SetAnimationTime(double time);
106 
111  void SetTimeMode(int mode) override;
112 
116  int IsInPlay() { return this->InPlay; }
117 
119  {
120  PLAYMODE_SEQUENCE = 0,
121  PLAYMODE_REALTIME = 1
122  };
123 
124 protected:
126  ~vtkAnimationScene() override;
127 
129 
133  void TickInternal(double currenttime, double deltatime, double clocktime) override;
134  void StartCueInternal() override;
135  void EndCueInternal() override;
137 
140 
141  int PlayMode;
142  double FrameRate;
143  int Loop;
144  int InPlay;
145  int StopPlay;
146 
150 
151 private:
152  vtkAnimationScene(const vtkAnimationScene&) = delete;
153  void operator=(const vtkAnimationScene&) = delete;
154 };
155 
156 #endif
a seqin an animation.
the animation scene manager.
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)
void StartCueInternal() override
These are the internal methods that actually trigger they corresponding events.
void EndCueInternal() override
~vtkAnimationScene() override
void InitializeChildren()
static vtkAnimationScene * New()
void AddCue(vtkAnimationCue *cue)
Add/Remove an AnimationCue to/from the Scene.
vtkTimerLog * AnimationTimer
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:53
a simple class to control print indentation
Definition: vtkIndent.h:34
Timer support and logging.
Definition: vtkTimerLog.h:91
@ mode
Definition: vtkX3D.h:253
@ time
Definition: vtkX3D.h:503