VTK
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 "vtkRenderingCoreModule.h" // For export macro
54 #include "vtkObject.h"
55 
56 
57 class vtkTransform;
58 class vtkMatrix4x4;
59 class vtkProp3D;
62 class vtkTransformList;
63 
64 
65 class VTKRENDERINGCORE_EXPORT vtkTransformInterpolator : public vtkObject
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
70 
74  static vtkTransformInterpolator* New();
75 
79  int GetNumberOfTransforms();
80 
82 
87  double GetMinimumT();
88  double GetMaximumT();
90 
94  void Initialize();
95 
97 
105  void AddTransform(double t, vtkTransform *xform);
106  void AddTransform(double t, vtkMatrix4x4 *matrix);
107  void AddTransform(double t, vtkProp3D *prop3D);
109 
114  void RemoveTransform(double t);
115 
121  void InterpolateTransform(double t, vtkTransform *xform);
122 
126  enum {INTERPOLATION_TYPE_LINEAR=0,
128  INTERPOLATION_TYPE_MANUAL
129  };
130 
132 
141  vtkSetClampMacro(InterpolationType,int, INTERPOLATION_TYPE_LINEAR,
142  INTERPOLATION_TYPE_MANUAL);
143  vtkGetMacro(InterpolationType,int);
145  {this->SetInterpolationType(INTERPOLATION_TYPE_LINEAR);}
147  {this->SetInterpolationType(INTERPOLATION_TYPE_SPLINE);}
149  {this->SetInterpolationType(INTERPOLATION_TYPE_MANUAL);}
151 
153 
159  virtual void SetPositionInterpolator(vtkTupleInterpolator*);
160  vtkGetObjectMacro(PositionInterpolator,vtkTupleInterpolator);
162 
164 
170  virtual void SetScaleInterpolator(vtkTupleInterpolator*);
171  vtkGetObjectMacro(ScaleInterpolator,vtkTupleInterpolator);
173 
175 
181  virtual void SetRotationInterpolator(vtkQuaternionInterpolator*);
182  vtkGetObjectMacro(RotationInterpolator,vtkQuaternionInterpolator);
184 
189  vtkMTimeType GetMTime() VTK_OVERRIDE;
190 
191 protected:
193  ~vtkTransformInterpolator() VTK_OVERRIDE;
194 
195  // Control the interpolation type
196  int InterpolationType;
197 
198  // Interpolators
200  vtkTupleInterpolator *ScaleInterpolator;
201  vtkQuaternionInterpolator *RotationInterpolator;
202 
203  // Initialize the interpolating splines
204  int Initialized;
205  vtkTimeStamp InitializeTime;
206  void InitializeInterpolation();
207 
208  // Keep track of inserted data
209  vtkTransformList *TransformList;
210 
211 private:
212  vtkTransformInterpolator(const vtkTransformInterpolator&) VTK_DELETE_FUNCTION;
213  void operator=(const vtkTransformInterpolator&) VTK_DELETE_FUNCTION;
214 
215 };
216 
217 #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:53
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:300
interpolate a tuple of arbitray 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
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.
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...