VTK
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
61class vtkQuaterniond;
62class vtkQuaternionList;
63
64class VTKCOMMONMATH_EXPORT vtkQuaternionInterpolator : public vtkObject
65{
66public:
68 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
69
74
80
82
88 double GetMinimumT();
89 double GetMaximumT();
91
96 void Initialize();
97
99
105 void AddQuaternion(double t, const vtkQuaterniond& q);
106 void AddQuaternion(double t, double q[4]);
108
113 void RemoveQuaternion(double t);
114
116
122 void InterpolateQuaternion(double t, double q[4]);
124
128 enum {INTERPOLATION_TYPE_LINEAR=0,
129 INTERPOLATION_TYPE_SPLINE
130 };
131
133
140 vtkSetClampMacro(InterpolationType,int,INTERPOLATION_TYPE_LINEAR,
141 INTERPOLATION_TYPE_SPLINE);
142 vtkGetMacro(InterpolationType,int);
144 {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);}
146 {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);}
148
149protected:
152
153 // Specify the type of interpolation to use
154 int InterpolationType;
155
156 // Internal variables for interpolation functions
157 vtkQuaternionList *QuaternionList; //used for linear quaternion interpolation
158
159private:
160 vtkQuaternionInterpolator(const vtkQuaternionInterpolator&) VTK_DELETE_FUNCTION;
161 void operator=(const vtkQuaternionInterpolator&) VTK_DELETE_FUNCTION;
162
163};
164
165#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
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 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.
void AddQuaternion(double t, double q[4])
static vtkQuaternionInterpolator * New()
Instantiate the class.
int GetNumberOfQuaternions()
Return the number of quaternions in the list of quaternions to be interpolated.
~vtkQuaternionInterpolator() override
void InterpolateQuaternion(double t, double q[4])