VTK  9.3.20240612
vtkTransformInterpolator.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
41#ifndef vtkTransformInterpolator_h
42#define vtkTransformInterpolator_h
43
44#include "vtkObject.h"
45#include "vtkRenderingCoreModule.h" // For export macro
46
47VTK_ABI_NAMESPACE_BEGIN
48class vtkTransform;
49class vtkMatrix4x4;
50class vtkProp3D;
53class vtkTransformList;
54
55class VTKRENDERINGCORE_EXPORT vtkTransformInterpolator : public vtkObject
56{
57public:
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
65
70
72
77 double GetMinimumT();
78 double GetMaximumT();
80
84 void Initialize();
85
87
95 void AddTransform(double t, vtkTransform* xform);
96 void AddTransform(double t, vtkMatrix4x4* matrix);
97 void AddTransform(double t, vtkProp3D* prop3D);
99
104 void RemoveTransform(double t);
105
111 void InterpolateTransform(double t, vtkTransform* xform);
112
116 enum
117 {
118 INTERPOLATION_TYPE_LINEAR = 0,
120 INTERPOLATION_TYPE_MANUAL
121 };
122
124
133 vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, INTERPOLATION_TYPE_MANUAL);
134 vtkGetMacro(InterpolationType, int);
135 void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
136 void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
137 void SetInterpolationTypeToManual() { this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL); }
139
141
148 vtkGetObjectMacro(PositionInterpolator, vtkTupleInterpolator);
150
152
159 vtkGetObjectMacro(ScaleInterpolator, vtkTupleInterpolator);
161
163
170 vtkGetObjectMacro(RotationInterpolator, vtkQuaternionInterpolator);
172
178
179protected:
182
183 // Control the interpolation type
185
186 // Interpolators
190
191 // Initialize the interpolating splines
195
196 // Keep track of inserted data
197 vtkTransformList* TransformList;
198
199private:
201 void operator=(const vtkTransformInterpolator&) = delete;
202};
203
204VTK_ABI_NAMESPACE_END
205#endif
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 4x4 transformation matrices
abstract base class for most VTK objects
Definition vtkObject.h:162
represents an 3D object for placement in a rendered scene
Definition vtkProp3D.h:89
record modification and/or execution time
interpolate a series of transformation matrices
void SetInterpolationTypeToSpline()
These are convenience methods to switch between linear and spline interpolation.
virtual void SetRotationInterpolator(vtkQuaternionInterpolator *)
Set/Get the tuple interpolator used to interpolate the orientation portion of the transformation matr...
void Initialize()
Clear the list of transforms.
void AddTransform(double t, vtkTransform *xform)
Add another transform to the list of transformations defining the transform function.
void RemoveTransform(double t)
Delete the transform at a particular parameter t.
void InterpolateTransform(double t, vtkTransform *xform)
Interpolate the list of transforms and determine a new transform (i.e., fill in the transformation pr...
int GetNumberOfTransforms()
Return the number of transforms in the list of transforms.
vtkQuaternionInterpolator * RotationInterpolator
vtkTupleInterpolator * ScaleInterpolator
void SetInterpolationTypeToManual()
These are convenience methods to switch between linear and spline interpolation.
void AddTransform(double t, vtkMatrix4x4 *matrix)
Add another transform to the list of transformations defining the transform function.
void SetInterpolationTypeToLinear()
These are convenience methods to switch between linear and spline interpolation.
void AddTransform(double t, vtkProp3D *prop3D)
Add another transform to the list of transformations defining the transform function.
double GetMinimumT()
Obtain some information about the interpolation range.
static vtkTransformInterpolator * New()
Instantiate the class.
vtkMTimeType GetMTime() override
Override GetMTime() because we depend on the interpolators which may be modified outside of this clas...
virtual void SetPositionInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the position portion of the transformation matrix.
double GetMaximumT()
Obtain some information about the interpolation range.
~vtkTransformInterpolator() override
virtual void SetScaleInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the scale portion of the transformation matrix.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTupleInterpolator * PositionInterpolator
describes linear transformations via a 4x4 matrix
interpolate a tuple of arbitrary size
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270