IGSTK
/tmp/buildd/igstk-4.4.0/Source/igstkPerspectiveTransform.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Image Guided Surgery Software Toolkit
00004   Module:    $RCSfile: igstkPerspectiveTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-06-15 19:56:58 $
00007   Version:   $Revision: 1.2 $
00008 
00009   Copyright (c) ISC  Insight Software Consortium.  All rights reserved.
00010   See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __igstkPerspectiveTransform_h
00019 #define __igstkPerspectiveTransform_h
00020 
00021 #include "igstkTransformBase.h"
00022 
00023 #include "vtkMatrix4x4.h"
00024 #include "vtkPerspectiveTransform.h"
00025 #include "itkMatrix.h"
00026 
00027 #include "igstkMacros.h"
00028 
00029 namespace igstk 
00030 {
00031  
00046   class PerspectiveTransform : public TransformBase
00047 {
00048 public:
00050   typedef ::itk::Matrix<double, 3, 4> ExtrinsicMatrixType;
00052   typedef ::itk::Matrix<double, 3, 3> IntrinsicMatrixType;
00053 
00054 public:
00055 
00057   PerspectiveTransform();
00058   PerspectiveTransform( const PerspectiveTransform & t );
00059   virtual ~PerspectiveTransform();
00060 
00062   const PerspectiveTransform & operator=( 
00063     const PerspectiveTransform & inputTransform );
00064 
00065 
00070   void SetTransform( const ExtrinsicMatrixType &extrinsic,
00071                      const IntrinsicMatrixType &intrinsic,
00072                      ErrorType errorValue,
00073                      TimePeriodType millisecondsToExpiration );
00074 
00075  
00082   void ExportTransform( vtkPerspectiveTransform &outMatrix ) const;
00083 
00084 
00089   void ExportExtrinsicParameters( vtkMatrix4x4 & matrix ) const;
00090 
00091 
00095   void ExportIntrinsicParameters( vtkPerspectiveTransform &outMatrix ) const;
00096 
00097 
00099   void Print( std::ostream& os, itk::Indent indent ) const;
00100 
00101 
00102 protected:
00103 
00104   void PrintHeader( std::ostream& os, itk::Indent indent ) const;
00105 
00106   void PrintTrailer( std::ostream& itkNotUsed(os), 
00107                      itk::Indent itkNotUsed(indent) ) const;
00108 
00110   virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const; 
00111 
00112 private:
00113   ExtrinsicMatrixType m_ExtrinsicTransform;
00114   IntrinsicMatrixType m_IntrinsicTransform;
00115 };
00116 
00117 std::ostream& operator<<( std::ostream& os, 
00118                           const igstk::PerspectiveTransform& o );
00119 }
00120 
00121 #endif