VTK
dox/Common/DataModel/vtkAnimationScene.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkAnimationScene.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00032 #ifndef __vtkAnimationScene_h
00033 #define __vtkAnimationScene_h
00034 
00035 #include "vtkCommonDataModelModule.h" // For export macro
00036 #include "vtkAnimationCue.h"
00037 
00038 class vtkAnimationCue;
00039 class vtkCollection;
00040 class vtkCollectionIterator;
00041 class vtkTimerLog;
00042 
00043 class VTKCOMMONDATAMODEL_EXPORT vtkAnimationScene: public vtkAnimationCue
00044 {
00045 public:
00046   vtkTypeMacro(vtkAnimationScene, vtkAnimationCue);
00047   void PrintSelf(ostream& os, vtkIndent indent);
00048   static vtkAnimationScene* New();
00049 
00051 
00056   vtkSetMacro(PlayMode, int);
00057   void SetModeToSequence() { this->SetPlayMode(PLAYMODE_SEQUENCE); }
00058   void SetModeToRealTime() { this->SetPlayMode(PLAYMODE_REALTIME); }
00059   vtkGetMacro(PlayMode, int);
00061 
00063 
00066   vtkSetMacro(FrameRate, double);
00067   vtkGetMacro(FrameRate, double);
00069 
00071 
00073   void AddCue(vtkAnimationCue* cue);
00074   void RemoveCue(vtkAnimationCue* cue);
00075   void RemoveAllCues();
00076   int  GetNumberOfCues();
00078 
00081   virtual void Play();
00082 
00084   void Stop();
00085 
00087 
00088   vtkSetMacro(Loop, int);
00089   vtkGetMacro(Loop, int);
00091 
00093 
00094   void SetAnimationTime(double time);
00095   vtkGetMacro(AnimationTime, double);
00097 
00100   virtual void SetTimeMode(int mode);
00101 
00103   int IsInPlay() { return this->InPlay; }
00104 
00105 //BTX
00106   enum PlayModes
00107   {
00108     PLAYMODE_SEQUENCE=0,
00109     PLAYMODE_REALTIME=1
00110   };
00111 //ETX
00112 
00113 protected:
00114   vtkAnimationScene();
00115   ~vtkAnimationScene();
00116 
00118 
00119   virtual void TickInternal(double currenttime, double deltatime, double clocktime);
00120   virtual void StartCueInternal();
00121   virtual void EndCueInternal();
00123 
00124   void InitializeChildren();
00125   void FinalizeChildren();
00126 
00127   int PlayMode;
00128   double FrameRate;
00129   int Loop;
00130   int InPlay;
00131   int StopPlay;
00132   double AnimationTime;
00133 
00134   vtkCollection* AnimationCues;
00135   vtkCollectionIterator* AnimationCuesIterator;
00136   vtkTimerLog* AnimationTimer;
00137 
00138 private:
00139   vtkAnimationScene(const vtkAnimationScene&); // Not implemented.
00140   void operator=(const vtkAnimationScene&); // Not implemented.
00141 };
00142 
00143 #endif