VTK  9.0.1
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 =========================================================================*/
50 #ifndef vtkTransformInterpolator_h
51 #define vtkTransformInterpolator_h
52 
53 #include "vtkObject.h"
54 #include "vtkRenderingCoreModule.h" // For export macro
55 
56 class vtkTransform;
57 class vtkMatrix4x4;
58 class vtkProp3D;
61 class vtkTransformList;
62 
63 class VTKRENDERINGCORE_EXPORT vtkTransformInterpolator : public vtkObject
64 {
65 public:
67  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
72  static vtkTransformInterpolator* New();
73 
77  int GetNumberOfTransforms();
78 
80 
85  double GetMinimumT();
86  double GetMaximumT();
88 
92  void Initialize();
93 
95 
103  void AddTransform(double t, vtkTransform* xform);
104  void AddTransform(double t, vtkMatrix4x4* matrix);
105  void AddTransform(double t, vtkProp3D* prop3D);
107 
112  void RemoveTransform(double t);
113 
119  void InterpolateTransform(double t, vtkTransform* xform);
120 
124  enum
125  {
126  INTERPOLATION_TYPE_LINEAR = 0,
128  INTERPOLATION_TYPE_MANUAL
129  };
130 
132 
141  vtkSetClampMacro(InterpolationType, int, INTERPOLATION_TYPE_LINEAR, INTERPOLATION_TYPE_MANUAL);
142  vtkGetMacro(InterpolationType, int);
143  void SetInterpolationTypeToLinear() { this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR); }
144  void SetInterpolationTypeToSpline() { this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE); }
145  void SetInterpolationTypeToManual() { this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL); }
147 
149 
155  virtual void SetPositionInterpolator(vtkTupleInterpolator*);
156  vtkGetObjectMacro(PositionInterpolator, vtkTupleInterpolator);
158 
160 
166  virtual void SetScaleInterpolator(vtkTupleInterpolator*);
167  vtkGetObjectMacro(ScaleInterpolator, vtkTupleInterpolator);
169 
171 
177  virtual void SetRotationInterpolator(vtkQuaternionInterpolator*);
178  vtkGetObjectMacro(RotationInterpolator, vtkQuaternionInterpolator);
180 
185  vtkMTimeType GetMTime() override;
186 
187 protected:
189  ~vtkTransformInterpolator() override;
190 
191  // Control the interpolation type
193 
194  // Interpolators
198 
199  // Initialize the interpolating splines
202  void InitializeInterpolation();
203 
204  // Keep track of inserted data
205  vtkTransformList* TransformList;
206 
207 private:
209  void operator=(const vtkTransformInterpolator&) = delete;
210 };
211 
212 #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:35
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
interpolate a tuple of arbitrary size
record modification and/or execution time
Definition: vtkTimeStamp.h:32
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:43
vtkQuaternionInterpolator * RotationInterpolator
a simple class to control print indentation
Definition: vtkIndent.h:33
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...