Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkLandmarkTransform.h

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