00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00054 #ifndef __vtkCameraInterpolator_h
00055 #define __vtkCameraInterpolator_h
00056
00057 #include "vtkObject.h"
00058
00059 class vtkCamera;
00060 class vtkCameraList;
00061 class vtkTupleInterpolator;
00062 class vtkCameraList;
00063
00064
00065 class VTK_RENDERING_EXPORT vtkCameraInterpolator : public vtkObject
00066 {
00067 public:
00068 vtkTypeMacro(vtkCameraInterpolator, vtkObject);
00069 void PrintSelf(ostream& os, vtkIndent indent);
00070
00072 static vtkCameraInterpolator* New();
00073
00075 int GetNumberOfCameras();
00076
00078
00080 double GetMinimumT();
00081 double GetMaximumT();
00083
00085 void Initialize();
00086
00091 void AddCamera(double t, vtkCamera *camera);
00092
00095 void RemoveCamera(double t);
00096
00100 void InterpolateCamera(double t, vtkCamera *camera);
00101
00102
00104
00105 enum {INTERPOLATION_TYPE_LINEAR=0,
00106 INTERPOLATION_TYPE_SPLINE,
00107 INTERPOLATION_TYPE_MANUAL
00108 };
00109
00111
00113
00121 vtkSetClampMacro(InterpolationType,int, INTERPOLATION_TYPE_LINEAR,
00122 INTERPOLATION_TYPE_MANUAL);
00123 vtkGetMacro(InterpolationType,int);
00124 void SetInterpolationTypeToLinear()
00125 {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);}
00126 void SetInterpolationTypeToSpline()
00127 {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);}
00128 void SetInterpolationTypeToManual()
00129 {this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL);}
00131
00133
00137 virtual void SetPositionInterpolator(vtkTupleInterpolator*);
00138 vtkGetObjectMacro(PositionInterpolator,vtkTupleInterpolator);
00140
00142
00146 virtual void SetFocalPointInterpolator(vtkTupleInterpolator*);
00147 vtkGetObjectMacro(FocalPointInterpolator,vtkTupleInterpolator);
00149
00151
00155 virtual void SetViewUpInterpolator(vtkTupleInterpolator*);
00156 vtkGetObjectMacro(ViewUpInterpolator,vtkTupleInterpolator);
00158
00160
00164 virtual void SetViewAngleInterpolator(vtkTupleInterpolator*);
00165 vtkGetObjectMacro(ViewAngleInterpolator,vtkTupleInterpolator);
00167
00169
00173 virtual void SetParallelScaleInterpolator(vtkTupleInterpolator*);
00174 vtkGetObjectMacro(ParallelScaleInterpolator,vtkTupleInterpolator);
00176
00178
00182 virtual void SetClippingRangeInterpolator(vtkTupleInterpolator*);
00183 vtkGetObjectMacro(ClippingRangeInterpolator,vtkTupleInterpolator);
00185
00188 unsigned long GetMTime();
00189
00190 protected:
00191 vtkCameraInterpolator();
00192 virtual ~vtkCameraInterpolator();
00193
00194
00195 int InterpolationType;
00196
00197
00198 vtkTupleInterpolator *PositionInterpolator;
00199 vtkTupleInterpolator *FocalPointInterpolator;
00200 vtkTupleInterpolator *ViewUpInterpolator;
00201 vtkTupleInterpolator *ViewAngleInterpolator;
00202 vtkTupleInterpolator *ParallelScaleInterpolator;
00203 vtkTupleInterpolator *ClippingRangeInterpolator;
00204
00205
00206 int Initialized;
00207 vtkTimeStamp InitializeTime;
00208 void InitializeInterpolation();
00209
00210
00211 vtkCameraList *CameraList;
00212
00213 private:
00214 vtkCameraInterpolator(const vtkCameraInterpolator&);
00215 void operator=(const vtkCameraInterpolator&);
00216
00217 };
00218
00219 #endif