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;
53 class vtkTransformList;
54 
55 class VTKRENDERINGCORE_EXPORT vtkTransformInterpolator : public vtkObject
56 {
57 public:
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,
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:
181  ~vtkTransformInterpolator() override;
182 
183  // Control the interpolation type
185 
186  // Interpolators
190 
191  // Initialize the interpolating splines
194  void InitializeInterpolation();
195 
196  // Keep track of inserted data
197  vtkTransformList* TransformList;
198 
199 private:
201  void operator=(const vtkTransformInterpolator&) = delete;
202 };
203 
204 VTK_ABI_NAMESPACE_END
205 #endif
interpolate a quaternion
void SetInterpolationTypeToSpline()
These are convenience methods to switch between linear and spline interpolation.
abstract base class for most VTK objects
Definition: vtkObject.h:51
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
interpolate a tuple of arbitrary size
record modification and/or execution time
Definition: vtkTimeStamp.h:24
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:49
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:38
vtkQuaternionInterpolator * RotationInterpolator
a simple class to control print indentation
Definition: vtkIndent.h:28
interpolate a series of transformation matrices
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void SetInterpolationTypeToLinear()
These are convenience methods to switch between linear and spline interpolation.
vtkTupleInterpolator * PositionInterpolator
vtkTupleInterpolator * ScaleInterpolator
void SetInterpolationTypeToManual()
These are convenience methods to switch between linear and spline interpolation.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...