VTK
vtkQuaternionInterpolator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQuaternionInterpolator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
55 #ifndef vtkQuaternionInterpolator_h
56 #define vtkQuaternionInterpolator_h
57 
58 #include "vtkCommonMathModule.h" // For export macro
59 #include "vtkObject.h"
60 
61 class vtkQuaterniond;
62 class vtkQuaternionList;
63 
64 class VTKCOMMONMATH_EXPORT vtkQuaternionInterpolator : public vtkObject
65 {
66 public:
68  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
69 
74 
80 
82 
88  double GetMinimumT();
89  double GetMaximumT();
91 
96  void Initialize();
97 
99 
105  void AddQuaternion(double t, const vtkQuaterniond& q);
106  void AddQuaternion(double t, double q[4]);
108 
113  void RemoveQuaternion(double t);
114 
116 
122  void InterpolateQuaternion(double t, double q[4]);
124 
128  enum {INTERPOLATION_TYPE_LINEAR=0,
129  INTERPOLATION_TYPE_SPLINE
130  };
131 
133 
140  vtkSetClampMacro(InterpolationType,int,INTERPOLATION_TYPE_LINEAR,
141  INTERPOLATION_TYPE_SPLINE);
142  vtkGetMacro(InterpolationType,int);
144  {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);}
146  {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);}
148 
149 protected:
152 
153  // Specify the type of interpolation to use
154  int InterpolationType;
155 
156  // Internal variables for interpolation functions
157  vtkQuaternionList *QuaternionList; //used for linear quaternion interpolation
158 
159 private:
160  vtkQuaternionInterpolator(const vtkQuaternionInterpolator&) VTK_DELETE_FUNCTION;
161  void operator=(const vtkQuaternionInterpolator&) VTK_DELETE_FUNCTION;
162 
163 };
164 
165 #endif
vtkQuaternionInterpolator::GetMaximumT
double GetMaximumT()
vtkQuaternionInterpolator::InterpolateQuaternion
void InterpolateQuaternion(double t, vtkQuaterniond &q)
Interpolate the list of quaternions and determine a new quaternion (i.e., fill in the quaternion prov...
vtkQuaternionInterpolator
interpolate a quaternion
Definition: vtkQuaternionInterpolator.h:65
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkQuaternionInterpolator::SetInterpolationTypeToSpline
void SetInterpolationTypeToSpline()
Definition: vtkQuaternionInterpolator.h:145
vtkQuaternionInterpolator::AddQuaternion
void AddQuaternion(double t, const vtkQuaterniond &q)
Add another quaternion to the list of quaternions to be interpolated.
vtkQuaterniond
Definition: vtkQuaternion.h:427
vtkQuaternionInterpolator::RemoveQuaternion
void RemoveQuaternion(double t)
Delete the quaternion at a particular parameter t.
vtkQuaternionInterpolator::Initialize
void Initialize()
Reset the class so that it contains no data; i.e., the array of (t,q[4]) information is discarded.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkQuaternionInterpolator::New
static vtkQuaternionInterpolator * New()
Instantiate the class.
vtkObject.h
vtkQuaternionInterpolator::~vtkQuaternionInterpolator
~vtkQuaternionInterpolator() override
vtkQuaternionInterpolator::InterpolateQuaternion
void InterpolateQuaternion(double t, double q[4])
vtkQuaternionInterpolator::SetInterpolationTypeToLinear
void SetInterpolationTypeToLinear()
Definition: vtkQuaternionInterpolator.h:143
vtkQuaternionInterpolator::AddQuaternion
void AddQuaternion(double t, double q[4])
vtkQuaternionInterpolator::vtkQuaternionInterpolator
vtkQuaternionInterpolator()
vtkQuaternionInterpolator::GetMinimumT
double GetMinimumT()
Obtain some information about the interpolation range.
vtkQuaternionInterpolator::GetNumberOfQuaternions
int GetNumberOfQuaternions()
Return the number of quaternions in the list of quaternions to be interpolated.
vtkQuaternionInterpolator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.