VTK  9.2.5
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 =========================================================================*/
58 #ifndef vtkQuaternionInterpolator_h
59 #define vtkQuaternionInterpolator_h
60 
61 #include "vtkCommonMathModule.h" // For export macro
62 #include "vtkObject.h"
63 
64 class vtkQuaterniond;
65 class vtkQuaternionList;
66 
67 class VTKCOMMONMATH_EXPORT vtkQuaternionInterpolator : public vtkObject
68 {
69 public:
71  void PrintSelf(ostream& os, vtkIndent indent) override;
72 
77 
79  {
80  BinarySearch = 0,
81  LinearSearch = 1,
82  MaxEnum
83  };
84 
90 
92 
98  double GetMinimumT();
99  double GetMaximumT();
101 
106  void Initialize();
107 
109 
115  void AddQuaternion(double t, const vtkQuaterniond& q);
116  void AddQuaternion(double t, double q[4]);
118 
123  void RemoveQuaternion(double t);
124 
126 
132  void InterpolateQuaternion(double t, double q[4]);
134 
136 
144 
148  enum
149  {
150  INTERPOLATION_TYPE_LINEAR = 0,
151  INTERPOLATION_TYPE_SPLINE
152  };
153 
155 
163  vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, INTERPOLATION_TYPE_SPLINE);
164  vtkGetMacro(InterpolationType, int);
165  void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
166  void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
168 
169 protected:
172 
173  // Specify the type of interpolation to use
176 
177  // Internal variables for interpolation functions
178  vtkQuaternionList* QuaternionList; // used for linear quaternion interpolation
179 
180 private:
182  void operator=(const vtkQuaternionInterpolator&) = delete;
183 };
184 
185 #endif
a simple class to control print indentation
Definition: vtkIndent.h:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
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