IGSTK
/tmp/buildd/igstk-4.4.0/Source/igstkCoordinateSystemTransformToResult.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Image Guided Surgery Software Toolkit
00004   Module:    $RCSfile: igstkCoordinateSystemTransformToResult.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-02-02 21:00:06 $
00007   Version:   $Revision: 1.6 $
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 __igstkCoordinateSystemTransformToResult_h
00019 #define __igstkCoordinateSystemTransformToResult_h
00020 
00021 #include "igstkCoordinateSystem.h"
00022 
00023 namespace igstk
00024 {
00025 
00038 class CoordinateSystemTransformToResult
00039 {
00040 public:
00041 
00043   CoordinateSystemTransformToResult();
00044 
00046   CoordinateSystemTransformToResult(
00047       const CoordinateSystemTransformToResult& in);
00048 
00050   const CoordinateSystemTransformToResult &operator = ( 
00051       const CoordinateSystemTransformToResult& in);
00052 
00058   void Clear();
00059 
00061   void Initialize(const Transform& transform, 
00062                   const CoordinateSystem* source,
00063                   const CoordinateSystem* destination,
00064           const CoordinateSystem* commonAncestor);
00065 
00068   void Initialize(const Transform& transform, 
00069                   const CoordinateSystem* source,
00070                   const CoordinateSystem* destination);
00071           
00074   template <class TSource, class TDestination>
00075   void Initialize(const Transform& transform, 
00076                   const TSource * sourceObject,
00077                   const TDestination * destinationObject )
00078     {
00079     const CoordinateSystem * source =
00080       Friends::CoordinateSystemHelper::GetCoordinateSystem( sourceObject );
00081 
00082     const CoordinateSystem * destination =
00083       Friends::CoordinateSystemHelper::GetCoordinateSystem( destinationObject );
00084 
00085     this->Initialize( transform, source, destination );
00086     }
00087 
00089   const Transform & GetTransform() const;
00090 
00092   const CoordinateSystem * GetSource() const;
00093 
00095   const CoordinateSystem * GetDestination() const;
00096 
00098   const CoordinateSystem * GetCommonAncestor() const;
00099   
00100 private:
00101 
00102   Transform                        m_Transform;
00103   const CoordinateSystem       *   m_Source;
00104   const CoordinateSystem       *   m_Destination;
00105   const CoordinateSystem       *   m_CommonAncestor;
00106 
00107 };
00108 
00112 igstkLoadedEventMacro( CoordinateSystemTransformToEvent, 
00113                   IGSTKEvent, CoordinateSystemTransformToResult );
00114 
00115 } // end namespace igstk
00116 
00117 #endif