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
vtkQuaternionInterpolator::SearchMethod
int SearchMethod
Definition: vtkQuaternionInterpolator.h:172
vtkQuaternionInterpolator::vtkQuaternionInterpolationSearchMethod
vtkQuaternionInterpolationSearchMethod
Definition: vtkQuaternionInterpolator.h:76
vtkQuaternionInterpolator::InterpolationType
int InterpolationType
Definition: vtkQuaternionInterpolator.h:171
vtkQuaternionInterpolator::GetMaximumT
double GetMaximumT()
Obtain some information about the interpolation range.
vtkQuaternionInterpolator::InterpolateQuaternion
void InterpolateQuaternion(double t, vtkQuaterniond &q)
Interpolate the list of quaternions and determine a new quaternion (i.e., fill in the quaternion prov...
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkQuaternionInterpolator
interpolate a quaternion
Definition: vtkQuaternionInterpolator.h:65
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkQuaternionInterpolator::SetInterpolationTypeToSpline
void SetInterpolationTypeToSpline()
Specify which type of function to use for interpolation.
Definition: vtkQuaternionInterpolator.h:163
vtkQuaternionInterpolator::AddQuaternion
void AddQuaternion(double t, const vtkQuaterniond &q)
Add another quaternion to the list of quaternions to be interpolated.
vtkQuaternionInterpolator::SetSearchMethod
void SetSearchMethod(int type)
Set / Get the search type method.
vtkQuaterniond
Definition: vtkQuaternion.h:427
vtkQuaternionInterpolator::RemoveQuaternion
void RemoveQuaternion(double t)
Delete the quaternion at a particular parameter t.
vtkQuaternionInterpolator::Initialize
void Initialize()
Reset the class so that it contains no data; i.e., the array of (t,q[4]) information is discarded.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkQuaternionInterpolator::New
static vtkQuaternionInterpolator * New()
Instantiate the class.
vtkObject.h
vtkQuaternionInterpolator::~vtkQuaternionInterpolator
~vtkQuaternionInterpolator() override
vtkQuaternionInterpolator::InterpolateQuaternion
void InterpolateQuaternion(double t, double q[4])
Interpolate the list of quaternions and determine a new quaternion (i.e., fill in the quaternion prov...
vtkQuaternionInterpolator::SetInterpolationTypeToLinear
void SetInterpolationTypeToLinear()
Specify which type of function to use for interpolation.
Definition: vtkQuaternionInterpolator.h:162
vtkQuaternionInterpolator::QuaternionList
vtkQuaternionList * QuaternionList
Definition: vtkQuaternionInterpolator.h:175
vtkQuaternionInterpolator::AddQuaternion
void AddQuaternion(double t, double q[4])
Add another quaternion to the list of quaternions to be interpolated.
vtkQuaternionInterpolator::vtkQuaternionInterpolator
vtkQuaternionInterpolator()
vtkQuaternionInterpolator::GetMinimumT
double GetMinimumT()
Obtain some information about the interpolation range.
vtkQuaternionInterpolator::GetNumberOfQuaternions
int GetNumberOfQuaternions()
Return the number of quaternions in the list of quaternions to be interpolated.
vtkQuaternionInterpolator::GetSearchMethod
int GetSearchMethod()
Set / Get the search type method.
vtkQuaternionInterpolator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.