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