VTK  9.2.6
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 
89  int GetNumberOfQuaternions();
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 
131  void InterpolateQuaternion(double t, vtkQuaterniond& q);
132  void InterpolateQuaternion(double t, double q[4]);
134 
136 
141  int GetSearchMethod();
142  void SetSearchMethod(int type);
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:
171  ~vtkQuaternionInterpolator() override;
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
interpolate a quaternion
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:39
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...