VTK  9.2.6
vtkTransformInterpolator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTransformInterpolator.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 =========================================================================*/
53 #ifndef vtkTransformInterpolator_h
54 #define vtkTransformInterpolator_h
55 
56 #include "vtkObject.h"
57 #include "vtkRenderingCoreModule.h" // For export macro
58 
59 class vtkTransform;
60 class vtkMatrix4x4;
61 class vtkProp3D;
64 class vtkTransformList;
65 
66 class VTKRENDERINGCORE_EXPORT vtkTransformInterpolator : public vtkObject
67 {
68 public:
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
75  static vtkTransformInterpolator* New();
76 
80  int GetNumberOfTransforms();
81 
83 
88  double GetMinimumT();
89  double GetMaximumT();
91 
95  void Initialize();
96 
98 
106  void AddTransform(double t, vtkTransform* xform);
107  void AddTransform(double t, vtkMatrix4x4* matrix);
108  void AddTransform(double t, vtkProp3D* prop3D);
110 
115  void RemoveTransform(double t);
116 
122  void InterpolateTransform(double t, vtkTransform* xform);
123 
127  enum
128  {
129  INTERPOLATION_TYPE_LINEAR = 0,
131  INTERPOLATION_TYPE_MANUAL
132  };
133 
135 
144  vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, INTERPOLATION_TYPE_MANUAL);
145  vtkGetMacro(InterpolationType, int);
146  void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
147  void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
148  void SetInterpolationTypeToManual() { this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL); }
150 
152 
158  virtual void SetPositionInterpolator(vtkTupleInterpolator*);
159  vtkGetObjectMacro(PositionInterpolator, vtkTupleInterpolator);
161 
163 
169  virtual void SetScaleInterpolator(vtkTupleInterpolator*);
170  vtkGetObjectMacro(ScaleInterpolator, vtkTupleInterpolator);
172 
174 
180  virtual void SetRotationInterpolator(vtkQuaternionInterpolator*);
181  vtkGetObjectMacro(RotationInterpolator, vtkQuaternionInterpolator);
183 
188  vtkMTimeType GetMTime() override;
189 
190 protected:
192  ~vtkTransformInterpolator() override;
193 
194  // Control the interpolation type
196 
197  // Interpolators
201 
202  // Initialize the interpolating splines
205  void InitializeInterpolation();
206 
207  // Keep track of inserted data
208  vtkTransformList* TransformList;
209 
210 private:
212  void operator=(const vtkTransformInterpolator&) = delete;
213 };
214 
215 #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:62
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
interpolate a tuple of arbitrary size
record modification and/or execution time
Definition: vtkTimeStamp.h:35
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:49
vtkQuaternionInterpolator * RotationInterpolator
a simple class to control print indentation
Definition: vtkIndent.h:39
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...