VTK  9.1.0
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) override;
69 
74 
76  {
77  BinarySearch = 0,
78  LinearSearch = 1,
79  MaxEnum
80  };
81 
87 
89 
95  double GetMinimumT();
96  double GetMaximumT();
98 
103  void Initialize();
104 
106 
112  void AddQuaternion(double t, const vtkQuaterniond& q);
113  void AddQuaternion(double t, double q[4]);
115 
120  void RemoveQuaternion(double t);
121 
123 
129  void InterpolateQuaternion(double t, double q[4]);
131 
133 
141 
145  enum
146  {
147  INTERPOLATION_TYPE_LINEAR = 0,
148  INTERPOLATION_TYPE_SPLINE
149  };
150 
152 
160  vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, INTERPOLATION_TYPE_SPLINE);
161  vtkGetMacro(InterpolationType, int);
162  void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
163  void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
165 
166 protected:
169 
170  // Specify the type of interpolation to use
173 
174  // Internal variables for interpolation functions
175  vtkQuaternionList* QuaternionList; // used for linear quaternion interpolation
176 
177 private:
179  void operator=(const vtkQuaternionInterpolator&) = delete;
180 };
181 
182 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:63
double GetMaximumT()
Obtain some information about the interpolation range.
void InterpolateQuaternion(double t, vtkQuaterniond &q)
Interpolate the list of quaternions and determine a new quaternion (i.e., fill in the quaternion prov...
void AddQuaternion(double t, const vtkQuaterniond &q)
Add another quaternion to the list of quaternions to be interpolated.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetInterpolationTypeToLinear()
Specify which type of function to use for interpolation.
void Initialize()
Reset the class so that it contains no data; i.e., the array of (t,q[4]) information is discarded.
void RemoveQuaternion(double t)
Delete the quaternion at a particular parameter t.
double GetMinimumT()
Obtain some information about the interpolation range.
int GetSearchMethod()
Set / Get the search type method.
void AddQuaternion(double t, double q[4])
Add another quaternion to the list of quaternions to be interpolated.
void SetInterpolationTypeToSpline()
Specify which type of function to use for interpolation.
static vtkQuaternionInterpolator * New()
Instantiate the class.
int GetNumberOfQuaternions()
Return the number of quaternions in the list of quaternions to be interpolated.
~vtkQuaternionInterpolator() override
void SetSearchMethod(int type)
Set / Get the search type method.
void InterpolateQuaternion(double t, double q[4])
Interpolate the list of quaternions and determine a new quaternion (i.e., fill in the quaternion prov...
@ type
Definition: vtkX3D.h:522