00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00052 #ifndef __vtkTransformInterpolator_h
00053 #define __vtkTransformInterpolator_h
00054
00055 #include "vtkObject.h"
00056
00057
00058 class vtkTransform;
00059 class vtkMatrix4x4;
00060 class vtkProp3D;
00061 class vtkTupleInterpolator;
00062 class vtkQuaternionInterpolator;
00063 class vtkTransformList;
00064
00065
00066 class VTK_RENDERING_EXPORT vtkTransformInterpolator : public vtkObject
00067 {
00068 public:
00069 vtkTypeMacro(vtkTransformInterpolator, vtkObject);
00070 void PrintSelf(ostream& os, vtkIndent indent);
00071
00073 static vtkTransformInterpolator* New();
00074
00076 int GetNumberOfTransforms();
00077
00079
00082 double GetMinimumT();
00083 double GetMaximumT();
00085
00087 void Initialize();
00088
00090
00096 void AddTransform(double t, vtkTransform *xform);
00097 void AddTransform(double t, vtkMatrix4x4 *matrix);
00098 void AddTransform(double t, vtkProp3D *prop3D);
00100
00103 void RemoveTransform(double t);
00104
00108 void InterpolateTransform(double t, vtkTransform *xform);
00109
00110
00112
00113 enum {INTERPOLATION_TYPE_LINEAR=0,
00114 INTERPOLATION_TYPE_SPLINE,
00115 INTERPOLATION_TYPE_MANUAL
00116 };
00117
00119
00121
00128 vtkSetClampMacro(InterpolationType,int, INTERPOLATION_TYPE_LINEAR,
00129 INTERPOLATION_TYPE_MANUAL);
00130 vtkGetMacro(InterpolationType,int);
00131 void SetInterpolationTypeToLinear()
00132 {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);}
00133 void SetInterpolationTypeToSpline()
00134 {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);}
00135 void SetInterpolationTypeToManual()
00136 {this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL);}
00138
00140
00144 virtual void SetPositionInterpolator(vtkTupleInterpolator*);
00145 vtkGetObjectMacro(PositionInterpolator,vtkTupleInterpolator);
00147
00149
00153 virtual void SetScaleInterpolator(vtkTupleInterpolator*);
00154 vtkGetObjectMacro(ScaleInterpolator,vtkTupleInterpolator);
00156
00158
00162 virtual void SetRotationInterpolator(vtkQuaternionInterpolator*);
00163 vtkGetObjectMacro(RotationInterpolator,vtkQuaternionInterpolator);
00165
00168 unsigned long GetMTime();
00169
00170 protected:
00171 vtkTransformInterpolator();
00172 virtual ~vtkTransformInterpolator();
00173
00174
00175 int InterpolationType;
00176
00177
00178 vtkTupleInterpolator *PositionInterpolator;
00179 vtkTupleInterpolator *ScaleInterpolator;
00180 vtkQuaternionInterpolator *RotationInterpolator;
00181
00182
00183 int Initialized;
00184 vtkTimeStamp InitializeTime;
00185 void InitializeInterpolation();
00186
00187
00188 vtkTransformList *TransformList;
00189
00190 private:
00191 vtkTransformInterpolator(const vtkTransformInterpolator&);
00192 void operator=(const vtkTransformInterpolator&);
00193
00194 };
00195
00196 #endif