00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkLandmarkTransform.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00046 #ifndef __vtkLandmarkTransform_h 00047 #define __vtkLandmarkTransform_h 00048 00049 #include "vtkLinearTransform.h" 00050 00051 #define VTK_LANDMARK_RIGIDBODY 6 00052 #define VTK_LANDMARK_SIMILARITY 7 00053 #define VTK_LANDMARK_AFFINE 12 00054 00055 class VTK_HYBRID_EXPORT vtkLandmarkTransform : public vtkLinearTransform 00056 { 00057 public: 00058 static vtkLandmarkTransform *New(); 00059 00060 vtkTypeRevisionMacro(vtkLandmarkTransform,vtkLinearTransform); 00061 void PrintSelf(ostream& os, vtkIndent indent); 00062 00064 00068 void SetSourceLandmarks(vtkPoints *points); 00069 void SetTargetLandmarks(vtkPoints *points); 00070 vtkGetObjectMacro(SourceLandmarks, vtkPoints); 00071 vtkGetObjectMacro(TargetLandmarks, vtkPoints); 00073 00075 00078 vtkSetMacro(Mode,int); 00079 void SetModeToRigidBody() { this->SetMode(VTK_LANDMARK_RIGIDBODY); }; 00080 void SetModeToSimilarity() { this->SetMode(VTK_LANDMARK_SIMILARITY); }; 00081 void SetModeToAffine() { this->SetMode(VTK_LANDMARK_AFFINE); }; 00082 vtkGetMacro(Mode,int); 00083 const char *GetModeAsString(); 00085 00088 void Inverse(); 00089 00091 unsigned long GetMTime(); 00092 00094 vtkAbstractTransform *MakeTransform(); 00095 00096 protected: 00097 vtkLandmarkTransform(); 00098 ~vtkLandmarkTransform(); 00099 00100 // Update the matrix from the quaternion. 00101 void InternalUpdate(); 00102 00104 void InternalDeepCopy(vtkAbstractTransform *transform); 00105 00106 vtkPoints* SourceLandmarks; 00107 vtkPoints* TargetLandmarks; 00108 00109 int Mode; 00110 private: 00111 vtkLandmarkTransform(const vtkLandmarkTransform&); // Not implemented. 00112 void operator=(const vtkLandmarkTransform&); // Not implemented. 00113 }; 00114 00115 //BTX 00116 inline const char *vtkLandmarkTransform::GetModeAsString() 00117 { 00118 switch (this->Mode) 00119 { 00120 case VTK_LANDMARK_RIGIDBODY: 00121 return "RigidBody"; 00122 case VTK_LANDMARK_SIMILARITY: 00123 return "Similarity"; 00124 case VTK_LANDMARK_AFFINE: 00125 return "Affine"; 00126 default: 00127 return "Unrecognized"; 00128 } 00129 } 00130 //ETX 00131 #endif