VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkLandmarkTransform.h 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 =========================================================================*/ 00031 #ifndef __vtkLandmarkTransform_h 00032 #define __vtkLandmarkTransform_h 00033 00034 #include "vtkCommonTransformsModule.h" // For export macro 00035 #include "vtkLinearTransform.h" 00036 00037 #define VTK_LANDMARK_RIGIDBODY 6 00038 #define VTK_LANDMARK_SIMILARITY 7 00039 #define VTK_LANDMARK_AFFINE 12 00040 00041 class VTKCOMMONTRANSFORMS_EXPORT vtkLandmarkTransform : public vtkLinearTransform 00042 { 00043 public: 00044 static vtkLandmarkTransform *New(); 00045 00046 vtkTypeMacro(vtkLandmarkTransform,vtkLinearTransform); 00047 void PrintSelf(ostream& os, vtkIndent indent); 00048 00050 00054 void SetSourceLandmarks(vtkPoints *points); 00055 void SetTargetLandmarks(vtkPoints *points); 00056 vtkGetObjectMacro(SourceLandmarks, vtkPoints); 00057 vtkGetObjectMacro(TargetLandmarks, vtkPoints); 00059 00061 00067 vtkSetMacro(Mode,int); 00068 void SetModeToRigidBody() { this->SetMode(VTK_LANDMARK_RIGIDBODY); }; 00069 void SetModeToSimilarity() { this->SetMode(VTK_LANDMARK_SIMILARITY); }; 00070 void SetModeToAffine() { this->SetMode(VTK_LANDMARK_AFFINE); }; 00072 00074 00075 vtkGetMacro(Mode,int); 00076 const char *GetModeAsString(); 00078 00081 void Inverse(); 00082 00084 unsigned long GetMTime(); 00085 00087 vtkAbstractTransform *MakeTransform(); 00088 00089 protected: 00090 vtkLandmarkTransform(); 00091 ~vtkLandmarkTransform(); 00092 00093 // Update the matrix from the quaternion. 00094 void InternalUpdate(); 00095 00097 void InternalDeepCopy(vtkAbstractTransform *transform); 00098 00099 vtkPoints* SourceLandmarks; 00100 vtkPoints* TargetLandmarks; 00101 00102 int Mode; 00103 private: 00104 vtkLandmarkTransform(const vtkLandmarkTransform&); // Not implemented. 00105 void operator=(const vtkLandmarkTransform&); // Not implemented. 00106 }; 00107 00108 //BTX 00109 inline const char *vtkLandmarkTransform::GetModeAsString() 00110 { 00111 switch (this->Mode) 00112 { 00113 case VTK_LANDMARK_RIGIDBODY: 00114 return "RigidBody"; 00115 case VTK_LANDMARK_SIMILARITY: 00116 return "Similarity"; 00117 case VTK_LANDMARK_AFFINE: 00118 return "Affine"; 00119 default: 00120 return "Unrecognized"; 00121 } 00122 } 00123 //ETX 00124 #endif