1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkMatrixToLinearTransform.h,v $
6 Date: $Date: 2002/12/26 18:24:21 $
7 Version: $Revision: 1.17 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
19 // .NAME vtkMatrixToLinearTransform - convert a matrix to a transform
20 // .SECTION Description
21 // This is a very simple class which allows a vtkMatrix4x4 to be used in
22 // place of a vtkLinearTransform or vtkAbstractTransform. For example,
23 // if you use it as a proxy between a matrix and vtkTransformPolyDataFilter
24 // then any modifications to the matrix will automatically be reflected in
25 // the output of the filter.
27 // vtkTransform vtkMatrix4x4 vtkMatrixToHomogeneousTransform
29 #ifndef __vtkMatrixToLinearTransform_h
30 #define __vtkMatrixToLinearTransform_h
32 #include "vtkLinearTransform.h"
36 class VTK_COMMON_EXPORT vtkMatrixToLinearTransform : public vtkLinearTransform
39 static vtkMatrixToLinearTransform *New();
40 vtkTypeRevisionMacro(vtkMatrixToLinearTransform,vtkLinearTransform);
41 void PrintSelf (ostream& os, vtkIndent indent);
44 // Set the input matrix. Any modifications to the matrix will be
45 // reflected in the transformation.
46 virtual void SetInput(vtkMatrix4x4*);
47 vtkGetObjectMacro(Input,vtkMatrix4x4);
50 // The input matrix is left as-is, but the transformation matrix
55 // Get the MTime: this is the bit of magic that makes everything work.
56 unsigned long GetMTime();
59 // Make a new transform of the same type.
60 vtkAbstractTransform *MakeTransform();
63 // This method is deprecated.
64 void SetMatrix(vtkMatrix4x4 *matrix) {
65 this->SetInput(matrix);
66 vtkWarningMacro("SetMatrix: deprecated, use SetInput() instead"); }
69 vtkMatrixToLinearTransform();
70 ~vtkMatrixToLinearTransform();
72 void InternalUpdate();
73 void InternalDeepCopy(vtkAbstractTransform *transform);
78 vtkMatrixToLinearTransform(const vtkMatrixToLinearTransform&); // Not implemented.
79 void operator=(const vtkMatrixToLinearTransform&); // Not implemented.