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
00143 virtual void SetFocalPointInterpolator(vtkTupleInterpolator*);
00144 vtkGetObjectMacro(FocalPointInterpolator,vtkTupleInterpolator);
00146
00148
00152 virtual void SetViewUpInterpolator(vtkTupleInterpolator*);
00153 vtkGetObjectMacro(ViewUpInterpolator,vtkTupleInterpolator);
00155
00157
00161 virtual void SetViewAngleInterpolator(vtkTupleInterpolator*);
00162 vtkGetObjectMacro(ViewAngleInterpolator,vtkTupleInterpolator);
00164
00166
00170 virtual void SetParallelScaleInterpolator(vtkTupleInterpolator*);
00171 vtkGetObjectMacro(ParallelScaleInterpolator,vtkTupleInterpolator);
00173
00175
00179 virtual void SetClippingRangeInterpolator(vtkTupleInterpolator*);
00180 vtkGetObjectMacro(ClippingRangeInterpolator,vtkTupleInterpolator);
00182
00185 unsigned long GetMTime();
00186
00187 protected:
00188 vtkCameraInterpolator();
00189 virtual ~vtkCameraInterpolator();
00190
00191
00192 int InterpolationType;
00193
00194
00195 vtkTupleInterpolator *PositionInterpolator;
00196 vtkTupleInterpolator *FocalPointInterpolator;
00197 vtkTupleInterpolator *ViewUpInterpolator;
00198 vtkTupleInterpolator *ViewAngleInterpolator;
00199 vtkTupleInterpolator *ParallelScaleInterpolator;
00200 vtkTupleInterpolator *ClippingRangeInterpolator;
00201
00202
00203 int Initialized;
00204 vtkTimeStamp InitializeTime;
00205 void InitializeInterpolation();
00206
00207
00208 vtkCameraList *CameraList;
00209
00210 private:
00211 vtkCameraInterpolator(const vtkCameraInterpolator&);
00212 void operator=(const vtkCameraInterpolator&);
00213
00214 };
00215
00216 #endif