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 =========================================================================*/
33 #ifndef vtkAnimationScene_h
34 #define vtkAnimationScene_h
35 
36 #include "vtkCommonDataModelModule.h" // For export macro
37 #include "vtkAnimationCue.h"
38 
39 class vtkAnimationCue;
40 class vtkCollection;
42 class vtkTimerLog;
43 
44 class VTKCOMMONDATAMODEL_EXPORT vtkAnimationScene: public vtkAnimationCue
45 {
46 public:
48  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
50 
52 
59  vtkSetMacro(PlayMode, int);
60  void SetModeToSequence() { this->SetPlayMode(PLAYMODE_SEQUENCE); }
61  void SetModeToRealTime() { this->SetPlayMode(PLAYMODE_REALTIME); }
62  vtkGetMacro(PlayMode, int);
64 
66 
71  vtkSetMacro(FrameRate, double);
72  vtkGetMacro(FrameRate, double);
74 
76 
80  void AddCue(vtkAnimationCue* cue);
82  void RemoveAllCues();
85 
90  virtual void Play();
91 
95  void Stop();
96 
98 
101  vtkSetMacro(Loop, int);
102  vtkGetMacro(Loop, int);
104 
108  void SetAnimationTime(double time);
109 
114  void SetTimeMode(int mode) VTK_OVERRIDE;
115 
119  int IsInPlay() { return this->InPlay; }
120 
122  {
123  PLAYMODE_SEQUENCE=0,
124  PLAYMODE_REALTIME=1
125  };
126 
127 protected:
129  ~vtkAnimationScene() VTK_OVERRIDE;
130 
132 
136  void TickInternal(double currenttime, double deltatime, double clocktime) VTK_OVERRIDE;
137  void StartCueInternal() VTK_OVERRIDE;
138  void EndCueInternal() VTK_OVERRIDE;
140 
141  void InitializeChildren();
142  void FinalizeChildren();
143 
144  int PlayMode;
145  double FrameRate;
146  int Loop;
147  int InPlay;
148  int StopPlay;
149  double AnimationTime;
150 
151  vtkCollection* AnimationCues;
152  vtkCollectionIterator* AnimationCuesIterator;
153  vtkTimerLog* AnimationTimer;
154 
155 private:
156  vtkAnimationScene(const vtkAnimationScene&) VTK_DELETE_FUNCTION;
157  void operator=(const vtkAnimationScene&) VTK_DELETE_FUNCTION;
158 };
159 
160 #endif
a seqin an animation.
the animation scene manager.
void SetAnimationTime(double time)
Makes the state of the scene same as the given time.
int IsInPlay()
Returns if the animation is being played.
void RemoveCue(vtkAnimationCue *cue)
~vtkAnimationScene() override
static vtkAnimationScene * New()
void AddCue(vtkAnimationCue *cue)
Add/Remove an AnimationCue to/from the 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.
virtual void Play()
Starts playing the animation scene.
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 unsorted lists of objects
Definition: vtkCollection.h:52
a simple class to control print indentation
Definition: vtkIndent.h:40
Timer support and logging.
Definition: vtkTimerLog.h:81
@ mode
Definition: vtkX3D.h:247
@ time
Definition: vtkX3D.h:497
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.