VTK
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;
46  static vtkAnimationScene* New();
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);
78  void RemoveCue(vtkAnimationCue* cue);
79  void RemoveAllCues();
80  int GetNumberOfCues();
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 
138  void InitializeChildren();
139  void FinalizeChildren();
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
vtkAnimationScene::FrameRate
double FrameRate
Definition: vtkAnimationScene.h:142
vtkAnimationCue::StartCueInternal
virtual void StartCueInternal()
These are the internal methods that actually trigger they corresponding events.
vtkAnimationCue::SetTimeMode
virtual void SetTimeMode(int mode)
Get/Set the time mode.
vtkAnimationScene::InPlay
int InPlay
Definition: vtkAnimationScene.h:144
vtkAnimationScene::SetModeToSequence
void SetModeToSequence()
Definition: vtkAnimationScene.h:57
vtkAnimationScene
the animation scene manager.
Definition: vtkAnimationScene.h:41
vtkAnimationScene::StopPlay
int StopPlay
Definition: vtkAnimationScene.h:145
vtkX3D::time
Definition: vtkX3D.h:503
vtkAnimationScene::AnimationTimer
vtkTimerLog * AnimationTimer
Definition: vtkAnimationScene.h:149
vtkAnimationScene::PlayModes
PlayModes
Definition: vtkAnimationScene.h:118
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:52
vtkAnimationScene::AnimationCues
vtkCollection * AnimationCues
Definition: vtkAnimationScene.h:147
vtkAnimationCue.h
vtkAnimationCue::EndCueInternal
virtual void EndCueInternal()
vtkAnimationCue
a seqin an animation.
Definition: vtkAnimationCue.h:44
vtkCollectionIterator
iterator through a vtkCollection.
Definition: vtkCollectionIterator.h:37
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkAnimationScene::IsInPlay
int IsInPlay()
Returns if the animation is being played.
Definition: vtkAnimationScene.h:116
vtkAnimationCue::TickInternal
virtual void TickInternal(double currenttime, double deltatime, double clocktime)
vtkAnimationScene::SetModeToRealTime
void SetModeToRealTime()
Definition: vtkAnimationScene.h:58
vtkAnimationCue::New
static vtkAnimationCue * New()
vtkAnimationScene::PlayMode
int PlayMode
Definition: vtkAnimationScene.h:141
vtkTimerLog
Timer support and logging.
Definition: vtkTimerLog.h:90
vtkAnimationScene::AnimationCuesIterator
vtkCollectionIterator * AnimationCuesIterator
Definition: vtkAnimationScene.h:148
vtkAnimationScene::Loop
int Loop
Definition: vtkAnimationScene.h:143
vtkX3D::mode
Definition: vtkX3D.h:253
vtkAnimationCue::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.