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 "vtkCommonDataModelModule.h" // For export macro
34 #include "vtkAnimationCue.h"
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
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:33
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.
iterator through a vtkCollection.
the animation scene manager.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:48
vtkCollectionIterator * AnimationCuesIterator