VTK
dox/Common/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 "vtkAnimationCue.h"
00036 
00037 class vtkAnimationCue;
00038 class vtkCollection;
00039 class vtkCollectionIterator;
00040 class vtkTimerLog;
00041 
00042 class VTK_COMMON_EXPORT vtkAnimationScene: public vtkAnimationCue
00043 {
00044 public:
00045   vtkTypeMacro(vtkAnimationScene, vtkAnimationCue);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047   static vtkAnimationScene* New();
00048 
00050 
00055   vtkSetMacro(PlayMode, int);
00056   void SetModeToSequence() { this->SetPlayMode(PLAYMODE_SEQUENCE); }
00057   void SetModeToRealTime() { this->SetPlayMode(PLAYMODE_REALTIME); }
00058   vtkGetMacro(PlayMode, int);
00060 
00062 
00065   vtkSetMacro(FrameRate, double);
00066   vtkGetMacro(FrameRate, double);
00068   
00070 
00072   void AddCue(vtkAnimationCue* cue);
00073   void RemoveCue(vtkAnimationCue* cue);
00074   void RemoveAllCues();
00075   int  GetNumberOfCues();
00077   
00080   virtual void Play();
00081 
00083   void Stop();
00084 
00086 
00087   vtkSetMacro(Loop, int);
00088   vtkGetMacro(Loop, int);
00090 
00092 
00093   void SetAnimationTime(double time);
00094   vtkGetMacro(AnimationTime, double);
00096 
00099   virtual void SetTimeMode(int mode);
00100 
00102   int IsInPlay() { return this->InPlay; } 
00103 
00104 //BTX
00105   enum PlayModes
00106   {
00107     PLAYMODE_SEQUENCE=0,
00108     PLAYMODE_REALTIME=1
00109   };
00110 //ETX
00111 
00112 protected:
00113   vtkAnimationScene();
00114   ~vtkAnimationScene();
00115 
00117 
00118   virtual void TickInternal(double currenttime, double deltatime, double clocktime);
00119   virtual void StartCueInternal();
00120   virtual void EndCueInternal();
00122 
00123   void InitializeChildren();
00124   void FinalizeChildren();
00125   
00126   int PlayMode;
00127   double FrameRate;
00128   int Loop;
00129   int InPlay;
00130   int StopPlay;
00131   double AnimationTime;
00132 
00133   vtkCollection* AnimationCues;
00134   vtkCollectionIterator* AnimationCuesIterator;
00135   vtkTimerLog* AnimationTimer;
00136   
00137 private:
00138   vtkAnimationScene(const vtkAnimationScene&); // Not implemented.
00139   void operator=(const vtkAnimationScene&); // Not implemented.
00140 };
00141 
00142 #endif