VTK  9.1.0
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 =========================================================================*/
59 #ifndef vtkAnimationScene_h
60 #define vtkAnimationScene_h
61 
62 #include "vtkAnimationCue.h"
63 #include "vtkCommonDataModelModule.h" // For export macro
64 
65 class vtkAnimationCue;
66 class vtkCollection;
68 class vtkTimerLog;
69 
70 class VTKCOMMONDATAMODEL_EXPORT vtkAnimationScene : public vtkAnimationCue
71 {
72 public:
74  void PrintSelf(ostream& os, vtkIndent indent) override;
76 
78 
85  vtkSetMacro(PlayMode, int);
86  void SetModeToSequence() { this->SetPlayMode(PLAYMODE_SEQUENCE); }
87  void SetModeToRealTime() { this->SetPlayMode(PLAYMODE_REALTIME); }
88  vtkGetMacro(PlayMode, int);
90 
92 
97  vtkSetMacro(FrameRate, double);
98  vtkGetMacro(FrameRate, double);
100 
102 
111 
116  virtual void Play();
117 
121  void Stop();
122 
124 
127  vtkSetMacro(Loop, int);
128  vtkGetMacro(Loop, int);
130 
134  void SetAnimationTime(double time);
135 
140  void SetTimeMode(int mode) override;
141 
145  int IsInPlay() { return this->InPlay; }
146 
148  {
149  PLAYMODE_SEQUENCE = 0,
150  PLAYMODE_REALTIME = 1
151  };
152 
153 protected:
155  ~vtkAnimationScene() override;
156 
158 
162  void TickInternal(double currenttime, double deltatime, double clocktime) override;
163  void StartCueInternal() override;
164  void EndCueInternal() override;
166 
169 
170  int PlayMode;
171  double FrameRate;
172  int Loop;
173  int InPlay;
174  int StopPlay;
175 
179 
180 private:
181  vtkAnimationScene(const vtkAnimationScene&) = delete;
182  void operator=(const vtkAnimationScene&) = delete;
183 };
184 
185 #endif
vtkAnimationScene::FrameRate
double FrameRate
Definition: vtkAnimationScene.h:171
vtkAnimationScene::~vtkAnimationScene
~vtkAnimationScene() override
vtkAnimationScene::FinalizeChildren
void FinalizeChildren()
vtkAnimationScene::RemoveCue
void RemoveCue(vtkAnimationCue *cue)
Add/Remove an AnimationCue to/from the Scene.
vtkAnimationScene::InPlay
int InPlay
Definition: vtkAnimationScene.h:173
vtkAnimationScene::SetModeToSequence
void SetModeToSequence()
Get/Set the PlayMode for running/playing the animation scene.
Definition: vtkAnimationScene.h:86
vtkAnimationScene
the animation scene manager.
Definition: vtkAnimationScene.h:71
vtkAnimationScene::StopPlay
int StopPlay
Definition: vtkAnimationScene.h:174
vtkX3D::time
@ time
Definition: vtkX3D.h:503
vtkAnimationScene::AnimationTimer
vtkTimerLog * AnimationTimer
Definition: vtkAnimationScene.h:178
vtkAnimationScene::AddCue
void AddCue(vtkAnimationCue *cue)
Add/Remove an AnimationCue to/from the Scene.
vtkAnimationScene::TickInternal
void TickInternal(double currenttime, double deltatime, double clocktime) override
Called on every valid tick.
vtkAnimationScene::PlayModes
PlayModes
Definition: vtkAnimationScene.h:148
vtkAnimationScene::New
static vtkAnimationScene * New()
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:53
vtkAnimationScene::AnimationCues
vtkCollection * AnimationCues
Definition: vtkAnimationScene.h:176
vtkAnimationCue.h
vtkAnimationScene::vtkAnimationScene
vtkAnimationScene()
vtkAnimationScene::SetTimeMode
void SetTimeMode(int mode) override
Overridden to allow change to Normalized mode only if none of the constituent cues is in Relative tim...
vtkAnimationCue
a seqin an animation.
Definition: vtkAnimationCue.h:80
vtkCollectionIterator
iterator through a vtkCollection.
Definition: vtkCollectionIterator.h:38
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkAnimationScene::IsInPlay
int IsInPlay()
Returns if the animation is being played.
Definition: vtkAnimationScene.h:145
vtkAnimationScene::SetModeToRealTime
void SetModeToRealTime()
Get/Set the PlayMode for running/playing the animation scene.
Definition: vtkAnimationScene.h:87
vtkAnimationScene::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAnimationScene::PlayMode
int PlayMode
Definition: vtkAnimationScene.h:170
vtkTimerLog
Timer support and logging.
Definition: vtkTimerLog.h:199
vtkAnimationScene::GetNumberOfCues
int GetNumberOfCues()
Add/Remove an AnimationCue to/from the Scene.
vtkAnimationScene::Play
virtual void Play()
Starts playing the animation scene.
vtkAnimationScene::AnimationCuesIterator
vtkCollectionIterator * AnimationCuesIterator
Definition: vtkAnimationScene.h:177
vtkAnimationScene::Loop
int Loop
Definition: vtkAnimationScene.h:172
vtkAnimationScene::RemoveAllCues
void RemoveAllCues()
Add/Remove an AnimationCue to/from the Scene.
vtkX3D::mode
@ mode
Definition: vtkX3D.h:253
vtkAnimationScene::SetAnimationTime
void SetAnimationTime(double time)
Makes the state of the scene same as the given time.
vtkAnimationScene::EndCueInternal
void EndCueInternal() override
Called on every valid tick.
vtkAnimationScene::StartCueInternal
void StartCueInternal() override
Called on every valid tick.
vtkAnimationScene::InitializeChildren
void InitializeChildren()
vtkAnimationScene::Stop
void Stop()
Stops the animation scene that is running.