VTK
dox/Hybrid/vtkLandmarkTransform.h
Go to the documentation of this file.
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 "vtkLinearTransform.h"
00035 
00036 #define VTK_LANDMARK_RIGIDBODY 6
00037 #define VTK_LANDMARK_SIMILARITY 7
00038 #define VTK_LANDMARK_AFFINE 12
00039 
00040 class VTK_HYBRID_EXPORT vtkLandmarkTransform : public vtkLinearTransform
00041 {
00042 public:
00043   static vtkLandmarkTransform *New();
00044 
00045   vtkTypeMacro(vtkLandmarkTransform,vtkLinearTransform);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049 
00053   void SetSourceLandmarks(vtkPoints *points);
00054   void SetTargetLandmarks(vtkPoints *points);
00055   vtkGetObjectMacro(SourceLandmarks, vtkPoints);
00056   vtkGetObjectMacro(TargetLandmarks, vtkPoints);
00058 
00060 
00066   vtkSetMacro(Mode,int);
00067   void SetModeToRigidBody() { this->SetMode(VTK_LANDMARK_RIGIDBODY); };
00068   void SetModeToSimilarity() { this->SetMode(VTK_LANDMARK_SIMILARITY); };
00069   void SetModeToAffine() { this->SetMode(VTK_LANDMARK_AFFINE); };
00071 
00073 
00074   vtkGetMacro(Mode,int);
00075   const char *GetModeAsString();
00077 
00080   void Inverse();
00081 
00083   unsigned long GetMTime();
00084 
00086   vtkAbstractTransform *MakeTransform();
00087 
00088 protected:
00089   vtkLandmarkTransform();
00090   ~vtkLandmarkTransform();
00091 
00092   // Update the matrix from the quaternion.
00093   void InternalUpdate();
00094 
00096   void InternalDeepCopy(vtkAbstractTransform *transform);
00097 
00098   vtkPoints* SourceLandmarks;
00099   vtkPoints* TargetLandmarks;
00100 
00101   int Mode;
00102 private:
00103   vtkLandmarkTransform(const vtkLandmarkTransform&);  // Not implemented.
00104   void operator=(const vtkLandmarkTransform&);  // Not implemented.
00105 };
00106  
00107 //BTX
00108 inline const char *vtkLandmarkTransform::GetModeAsString()
00109 {
00110   switch (this->Mode)
00111     {
00112     case VTK_LANDMARK_RIGIDBODY:
00113       return "RigidBody";
00114     case VTK_LANDMARK_SIMILARITY:
00115       return "Similarity";
00116     case VTK_LANDMARK_AFFINE:
00117       return "Affine";
00118     default:
00119       return "Unrecognized";
00120     }
00121 }
00122 //ETX
00123 #endif