VTK  9.3.20240419
vtkQuaternionInterpolator.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
46 #ifndef vtkQuaternionInterpolator_h
47 #define vtkQuaternionInterpolator_h
48 
49 #include "vtkCommonMathModule.h" // For export macro
50 #include "vtkObject.h"
51 
52 VTK_ABI_NAMESPACE_BEGIN
53 class vtkQuaterniond;
54 class vtkQuaternionList;
55 
56 class VTKCOMMONMATH_EXPORT vtkQuaternionInterpolator : public vtkObject
57 {
58 public:
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
66 
68  {
69  BinarySearch = 0,
70  LinearSearch = 1,
71  MaxEnum
72  };
73 
79 
81 
87  double GetMinimumT();
88  double GetMaximumT();
90 
95  void Initialize();
96 
98 
104  void AddQuaternion(double t, const vtkQuaterniond& q);
105  void AddQuaternion(double t, double q[4]);
107 
112  void RemoveQuaternion(double t);
113 
115 
121  void InterpolateQuaternion(double t, double q[4]);
123 
125 
133 
137  enum
138  {
139  INTERPOLATION_TYPE_LINEAR = 0,
140  INTERPOLATION_TYPE_SPLINE
141  };
142 
144 
152  vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, INTERPOLATION_TYPE_SPLINE);
153  vtkGetMacro(InterpolationType, int);
154  void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
155  void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
157 
158 protected:
161 
162  // Specify the type of interpolation to use
165 
166  // Internal variables for interpolation functions
167  vtkQuaternionList* QuaternionList; // used for linear quaternion interpolation
168 
169 private:
171  void operator=(const vtkQuaternionInterpolator&) = delete;
172 };
173 
174 VTK_ABI_NAMESPACE_END
175 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
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:516