VTK
dox/Common/Math/vtkQuaternionInterpolator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQuaternionInterpolator.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 =========================================================================*/
00054 #ifndef __vtkQuaternionInterpolator_h
00055 #define __vtkQuaternionInterpolator_h
00056 
00057 #include "vtkCommonMathModule.h" // For export macro
00058 #include "vtkObject.h"
00059 
00060 class vtkQuaterniond;
00061 class vtkQuaternionList;
00062 
00063 class VTKCOMMONMATH_EXPORT vtkQuaternionInterpolator : public vtkObject
00064 {
00065 public:
00066   vtkTypeMacro(vtkQuaternionInterpolator, vtkObject);
00067   void PrintSelf(ostream& os, vtkIndent indent);
00068 
00070   static vtkQuaternionInterpolator* New();
00071 
00074   int GetNumberOfQuaternions();
00075 
00077 
00081   double GetMinimumT();
00082   double GetMaximumT();
00084 
00087   void Initialize();
00088 
00090 
00094   void AddQuaternion(double t, const vtkQuaterniond& q);
00095   void AddQuaternion(double t, double q[4]);
00097 
00100   void RemoveQuaternion(double t);
00101 
00103 
00106   void InterpolateQuaternion(double t, vtkQuaterniond& q);
00107   void InterpolateQuaternion(double t, double q[4]);
00109 
00110 //BTX
00112 
00113   enum {INTERPOLATION_TYPE_LINEAR=0,
00114         INTERPOLATION_TYPE_SPLINE
00115   };
00116 //ETX
00118 
00120 
00125   vtkSetClampMacro(InterpolationType,int,INTERPOLATION_TYPE_LINEAR,
00126                    INTERPOLATION_TYPE_SPLINE);
00127   vtkGetMacro(InterpolationType,int);
00128   void SetInterpolationTypeToLinear()
00129     {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);}
00130   void SetInterpolationTypeToSpline()
00131     {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);}
00133 
00134 protected:
00135   vtkQuaternionInterpolator();
00136   virtual ~vtkQuaternionInterpolator();
00137 
00138   // Specify the type of interpolation to use
00139   int InterpolationType;
00140 
00141   // Internal variables for interpolation functions
00142   vtkQuaternionList *QuaternionList; //used for linear quaternion interpolation
00143 
00144 private:
00145   vtkQuaternionInterpolator(const vtkQuaternionInterpolator&);  // Not implemented.
00146   void operator=(const vtkQuaternionInterpolator&);  // Not implemented.
00147 
00148 };
00149 
00150 #endif