00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00051 #ifndef __vtkCameraInterpolator_h
00052 #define __vtkCameraInterpolator_h
00053
00054 #include "vtkObject.h"
00055
00056 class vtkCamera;
00057 class vtkCameraList;
00058 class vtkTupleInterpolator;
00059 class vtkCameraList;
00060
00061
00062 class VTK_RENDERING_EXPORT vtkCameraInterpolator : public vtkObject
00063 {
00064 public:
00065 vtkTypeRevisionMacro(vtkCameraInterpolator, vtkObject);
00066 void PrintSelf(ostream& os, vtkIndent indent);
00067
00069 static vtkCameraInterpolator* New();
00070
00072 int GetNumberOfCameras();
00073
00075
00077 double GetMinimumT();
00078 double GetMaximumT();
00080
00082 void Initialize();
00083
00088 void AddCamera(double t, vtkCamera *camera);
00089
00092 void RemoveCamera(double t);
00093
00097 void InterpolateCamera(double t, vtkCamera *camera);
00098
00099
00101
00102 enum {INTERPOLATION_TYPE_LINEAR=0,
00103 INTERPOLATION_TYPE_SPLINE,
00104 INTERPOLATION_TYPE_MANUAL
00105 };
00107
00108
00110
00118 vtkSetClampMacro(InterpolationType,int, INTERPOLATION_TYPE_LINEAR,
00119 INTERPOLATION_TYPE_MANUAL);
00120 vtkGetMacro(InterpolationType,int);
00121 void SetInterpolationTypeToLinear()
00122 {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);}
00123 void SetInterpolationTypeToSpline()
00124 {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);}
00125 void SetInterpolationTypeToManual()
00126 {this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL);}
00128
00130
00134 virtual void SetPositionInterpolator(vtkTupleInterpolator*);
00135 vtkGetObjectMacro(PositionInterpolator,vtkTupleInterpolator);
00137
00139 virtual void SetFocalPointInterpolator(vtkTupleInterpolator*);
00140 vtkGetObjectMacro(FocalPointInterpolator,vtkTupleInterpolator);
00142
00144 virtual void SetViewUpInterpolator(vtkTupleInterpolator*);
00145 vtkGetObjectMacro(ViewUpInterpolator,vtkTupleInterpolator);
00147
00149 virtual void SetViewAngleInterpolator(vtkTupleInterpolator*);
00150 vtkGetObjectMacro(ViewAngleInterpolator,vtkTupleInterpolator);
00152
00154 virtual void SetParallelScaleInterpolator(vtkTupleInterpolator*);
00155 vtkGetObjectMacro(ParallelScaleInterpolator,vtkTupleInterpolator);
00157
00159 virtual void SetClippingRangeInterpolator(vtkTupleInterpolator*);
00160 vtkGetObjectMacro(ClippingRangeInterpolator,vtkTupleInterpolator);
00162
00165 unsigned long GetMTime();
00166
00167 protected:
00168 vtkCameraInterpolator();
00169 virtual ~vtkCameraInterpolator();
00170
00171
00172 int InterpolationType;
00173
00174
00175 vtkTupleInterpolator *PositionInterpolator;
00176 vtkTupleInterpolator *FocalPointInterpolator;
00177 vtkTupleInterpolator *ViewUpInterpolator;
00178 vtkTupleInterpolator *ViewAngleInterpolator;
00179 vtkTupleInterpolator *ParallelScaleInterpolator;
00180 vtkTupleInterpolator *ClippingRangeInterpolator;
00181
00182
00183 int Initialized;
00184 vtkTimeStamp InitializeTime;
00185 void InitializeInterpolation();
00186
00187
00188 vtkCameraList *CameraList;
00189
00190 private:
00191 vtkCameraInterpolator(const vtkCameraInterpolator&);
00192 void operator=(const vtkCameraInterpolator&);
00193
00194 };
00195
00196 #endif