VTK
|
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 "vtkCommonCoreModule.h" // For export macro 00047 #include "vtkObject.h" 00048 00049 class VTKCOMMONCORE_EXPORT vtkAnimationCue: public vtkObject 00050 { 00051 public: 00052 vtkTypeMacro(vtkAnimationCue,vtkObject); 00053 void PrintSelf(ostream& os, vtkIndent indent); 00054 00055 static vtkAnimationCue* New(); 00056 00057 //BTX 00058 // Structure passed on every event invocation. 00059 // Depending upon the cue time mode, these times are either 00060 // normalized [0,1] or relative to the scene that contains the cue. 00061 // All this information is also available by asking the cue 00062 // directly for it within the handler. Thus, this information can 00063 // be accessed in wrapped languages. 00064 class AnimationCueInfo 00065 { 00066 public: 00067 double StartTime; 00068 double EndTime; 00069 double AnimationTime;// valid only in AnimationCueTickEvent handler 00070 double DeltaTime; // valid only in AnimationCueTickEvent handler 00071 double ClockTime; // valid only in AnimationCueTickEvent handler 00072 }; 00073 //ETX 00074 00076 00081 virtual void SetTimeMode(int mode); 00082 vtkGetMacro(TimeMode, int); 00083 void SetTimeModeToRelative() 00084 { this->SetTimeMode(TIMEMODE_RELATIVE); } 00085 void SetTimeModeToNormalized() 00086 { this->SetTimeMode(TIMEMODE_NORMALIZED); } 00088 00090 00097 vtkSetMacro(StartTime, double); 00098 vtkGetMacro(StartTime, double); 00100 00102 00108 vtkSetMacro(EndTime, double); 00109 vtkGetMacro(EndTime, double); 00111 00125 virtual void Tick(double currenttime, double deltatime, double clocktime); 00126 00129 virtual void Initialize(); 00130 00133 virtual void Finalize(); 00134 00136 00139 vtkGetMacro(AnimationTime, double); 00141 00143 00146 vtkGetMacro(DeltaTime, double); 00148 00150 00154 vtkGetMacro(ClockTime, double); 00156 00157 //BTX 00158 enum TimeCodes 00159 { 00160 TIMEMODE_NORMALIZED=0, 00161 TIMEMODE_RELATIVE=1 00162 }; 00163 //ETX 00164 protected: 00165 vtkAnimationCue(); 00166 ~vtkAnimationCue(); 00167 //BTX 00168 enum { 00169 UNINITIALIZED=0, 00170 INACTIVE, 00171 ACTIVE 00172 }; 00173 //ETX 00174 double StartTime; 00175 double EndTime; 00176 int TimeMode; 00177 00178 // These are set when the AnimationCueTickEvent event 00179 // is fired. Thus giving access to the information in 00180 // the AnimationCueInfo struct in wrapped languages. 00181 double AnimationTime; 00182 double DeltaTime; 00183 double ClockTime; 00184 00186 int CueState; 00187 00189 00192 virtual void StartCueInternal(); 00193 virtual void TickInternal(double currenttime, double deltatime, 00194 double clocktime); 00195 virtual void EndCueInternal(); 00197 00198 private: 00199 vtkAnimationCue(const vtkAnimationCue&); // Not implemented. 00200 void operator=(const vtkAnimationCue&); // Not implemented. 00201 }; 00202 00203 #endif 00204 00205 00206