VTK  9.3.1
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 
78  int GetNumberOfQuaternions();
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 
120  void InterpolateQuaternion(double t, vtkQuaterniond& q);
121  void InterpolateQuaternion(double t, double q[4]);
123 
125 
130  int GetSearchMethod();
131  void SetSearchMethod(int type);
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:
160  ~vtkQuaternionInterpolator() override;
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
interpolate a quaternion
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetInterpolationTypeToSpline()
Specify which type of function to use for interpolation.
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetInterpolationTypeToLinear()
Specify which type of function to use for interpolation.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...