VTK: Rendering/Core/vtkTransformInterpolator.h Source File

| VTK 9.3.1

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
47 VTK_ABI_NAMESPACE_BEGIN
48 class vtkTransform;
49 class vtkMatrix4x4;
50 class vtkProp3D;
51 class vtkTupleInterpolator;
52 class vtkQuaternionInterpolator;
53 class vtkTransformList;
54
55 class VTKRENDERINGCORE_EXPORT vtkTransformInterpolator : public vtkObject
56 {
57 public:
58 vtkTypeMacro(vtkTransformInterpolator, vtkObject);
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
64 static vtkTransformInterpolator* New();
65
69 int GetNumberOfTransforms();
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,
119 INTERPOLATION_TYPE_SPLINE,
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
147 virtual void SetPositionInterpolator(vtkTupleInterpolator*);
148 vtkGetObjectMacro(PositionInterpolator, vtkTupleInterpolator);
150
152
158 virtual void SetScaleInterpolator(vtkTupleInterpolator*);
159 vtkGetObjectMacro(ScaleInterpolator, vtkTupleInterpolator);
161
163
169 virtual void SetRotationInterpolator(vtkQuaternionInterpolator*);
170 vtkGetObjectMacro(RotationInterpolator, vtkQuaternionInterpolator);
172
177 vtkMTimeType GetMTime() override;
178
179 protected:
180 vtkTransformInterpolator();
181 ~vtkTransformInterpolator() override;
182
183 // Control the interpolation type
184 int InterpolationType;
185
186 // Interpolators
187 vtkTupleInterpolator* PositionInterpolator;
188 vtkTupleInterpolator* ScaleInterpolator;
189 vtkQuaternionInterpolator* RotationInterpolator;
190
191 // Initialize the interpolating splines
192 int Initialized;
193 vtkTimeStamp InitializeTime;
194 void InitializeInterpolation();
195
196 // Keep track of inserted data
197 vtkTransformList* TransformList;
198
199 private:
200 vtkTransformInterpolator(const vtkTransformInterpolator&) = delete;
201 void operator=(const vtkTransformInterpolator&) = delete;
202 };
203
204 VTK_ABI_NAMESPACE_END
205 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:40
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:48
vtkQuaternionInterpolator
interpolate a quaternion
Definition: vtkQuaternionInterpolator.h:57
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkTransformInterpolator
interpolate a series of transformation matrices
Definition: vtkTransformInterpolator.h:56
vtkTransformInterpolator::SetInterpolationTypeToSpline
void SetInterpolationTypeToSpline()
These are convenience methods to switch between linear and spline interpolation.
Definition: vtkTransformInterpolator.h:136
vtkTransformInterpolator::InterpolationType
int InterpolationType
Definition: vtkTransformInterpolator.h:184
vtkTransformInterpolator::SetRotationInterpolator
virtual void SetRotationInterpolator(vtkQuaternionInterpolator *)
Set/Get the tuple interpolator used to interpolate the orientation portion of the transformation matr...
vtkTransformInterpolator::Initialize
void Initialize()
Clear the list of transforms.
vtkTransformInterpolator::AddTransform
void AddTransform(double t, vtkTransform *xform)
Add another transform to the list of transformations defining the transform function.
vtkTransformInterpolator::Initialized
int Initialized
Definition: vtkTransformInterpolator.h:192
vtkTransformInterpolator::RemoveTransform
void RemoveTransform(double t)
Delete the transform at a particular parameter t.
vtkTransformInterpolator::InterpolateTransform
void InterpolateTransform(double t, vtkTransform *xform)
Interpolate the list of transforms and determine a new transform (i.e., fill in the transformation pr...
vtkTransformInterpolator::GetNumberOfTransforms
int GetNumberOfTransforms()
Return the number of transforms in the list of transforms.
vtkTransformInterpolator::RotationInterpolator
vtkQuaternionInterpolator * RotationInterpolator
Definition: vtkTransformInterpolator.h:189
vtkTransformInterpolator::vtkTransformInterpolator
vtkTransformInterpolator()
vtkTransformInterpolator::ScaleInterpolator
vtkTupleInterpolator * ScaleInterpolator
Definition: vtkTransformInterpolator.h:188
vtkTransformInterpolator::SetInterpolationTypeToManual
void SetInterpolationTypeToManual()
These are convenience methods to switch between linear and spline interpolation.
Definition: vtkTransformInterpolator.h:137
vtkTransformInterpolator::AddTransform
void AddTransform(double t, vtkMatrix4x4 *matrix)
Add another transform to the list of transformations defining the transform function.
vtkTransformInterpolator::SetInterpolationTypeToLinear
void SetInterpolationTypeToLinear()
These are convenience methods to switch between linear and spline interpolation.
Definition: vtkTransformInterpolator.h:135
vtkTransformInterpolator::AddTransform
void AddTransform(double t, vtkProp3D *prop3D)
Add another transform to the list of transformations defining the transform function.
vtkTransformInterpolator::GetMinimumT
double GetMinimumT()
Obtain some information about the interpolation range.
vtkTransformInterpolator::New
static vtkTransformInterpolator * New()
Instantiate the class.
vtkTransformInterpolator::GetMTime
vtkMTimeType GetMTime() override
Override GetMTime() because we depend on the interpolators which may be modified outside of this clas...
vtkTransformInterpolator::SetPositionInterpolator
virtual void SetPositionInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the position portion of the transformation matrix.
vtkTransformInterpolator::INTERPOLATION_TYPE_SPLINE
@ INTERPOLATION_TYPE_SPLINE
Definition: vtkTransformInterpolator.h:119
vtkTransformInterpolator::GetMaximumT
double GetMaximumT()
Obtain some information about the interpolation range.
vtkTransformInterpolator::InitializeTime
vtkTimeStamp InitializeTime
Definition: vtkTransformInterpolator.h:193
vtkTransformInterpolator::InitializeInterpolation
void InitializeInterpolation()
vtkTransformInterpolator::~vtkTransformInterpolator
~vtkTransformInterpolator() override
vtkTransformInterpolator::SetScaleInterpolator
virtual void SetScaleInterpolator(vtkTupleInterpolator *)
Set/Get the tuple interpolator used to interpolate the scale portion of the transformation matrix.
vtkTransformInterpolator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTransformInterpolator::TransformList
vtkTransformList * TransformList
Definition: vtkTransformInterpolator.h:197
vtkTransformInterpolator::PositionInterpolator
vtkTupleInterpolator * PositionInterpolator
Definition: vtkTransformInterpolator.h:187
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
vtkTupleInterpolator
interpolate a tuple of arbitrary size
Definition: vtkTupleInterpolator.h:55
vtkX3D::PositionInterpolator
@ PositionInterpolator
Definition: vtkX3D.h:145
vtkObject.h
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270