VTK
dox/Common/vtkAnimationCue.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkAnimationCue.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 =========================================================================*/
00043 #ifndef __vtkAnimationCue_h
00044 #define __vtkAnimationCue_h
00045 
00046 #include "vtkObject.h"
00047 
00048 class VTK_COMMON_EXPORT vtkAnimationCue: public vtkObject
00049 {
00050 public:
00051   vtkTypeMacro(vtkAnimationCue,vtkObject);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00053 
00054   static vtkAnimationCue* New();
00055 
00056   //BTX
00057   // Structure passed on every event invocation.
00058   // Depending upon the cue time mode, these times are either
00059   // normalized [0,1] or relative to the scene that contains the cue.
00060   // All this information is also available by asking the cue
00061   // directly for it within the handler. Thus, this information can 
00062   // be accessed in wrapped languages.
00063   class AnimationCueInfo
00064     {
00065   public:
00066     double StartTime;
00067     double EndTime;
00068     double AnimationTime;// valid only in AnimationCueTickEvent handler
00069     double DeltaTime;   // valid only in AnimationCueTickEvent handler
00070     double ClockTime;   // valid only in AnimationCueTickEvent handler
00071     };
00072   //ETX
00073   
00075 
00080   virtual void SetTimeMode(int mode);
00081   vtkGetMacro(TimeMode, int);
00082   void SetTimeModeToRelative() 
00083     { this->SetTimeMode(TIMEMODE_RELATIVE); }
00084   void SetTimeModeToNormalized() 
00085     { this->SetTimeMode(TIMEMODE_NORMALIZED); }
00087 
00089 
00096   vtkSetMacro(StartTime, double);
00097   vtkGetMacro(StartTime, double);
00099 
00101 
00107   vtkSetMacro(EndTime, double);
00108   vtkGetMacro(EndTime, double);
00110  
00124   virtual void Tick(double currenttime, double deltatime, double clocktime);
00125 
00128   virtual void Initialize();
00129 
00132   virtual void Finalize();
00133 
00135 
00138   vtkGetMacro(AnimationTime, double);
00140 
00142 
00145   vtkGetMacro(DeltaTime, double);
00147 
00149 
00153   vtkGetMacro(ClockTime, double);
00155 
00156 //BTX
00157   enum TimeCodes
00158   {
00159     TIMEMODE_NORMALIZED=0,
00160     TIMEMODE_RELATIVE=1
00161   };
00162 //ETX
00163 protected:
00164   vtkAnimationCue();
00165   ~vtkAnimationCue();
00166 //BTX
00167   enum {
00168     UNINITIALIZED=0,
00169     INACTIVE,
00170     ACTIVE
00171   };
00172 //ETX
00173   double StartTime;
00174   double EndTime;
00175   int TimeMode;
00176 
00177   // These are set when the AnimationCueTickEvent event 
00178   // is fired. Thus giving access to the information in
00179   // the AnimationCueInfo struct in wrapped languages.
00180   double AnimationTime;
00181   double DeltaTime;
00182   double ClockTime;
00183   
00185   int CueState;
00186 
00188 
00191   virtual void StartCueInternal();
00192   virtual void TickInternal(double currenttime, double deltatime,
00193     double clocktime);
00194   virtual void EndCueInternal();
00196  
00197 private:
00198   vtkAnimationCue(const vtkAnimationCue&);  // Not implemented.
00199   void operator=(const vtkAnimationCue&);  // Not implemented.
00200 };
00201 
00202 #endif
00203 
00204 
00205