Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkCellInterfaceVisitor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkCellInterfaceVisitor.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006-03-18 18:06:25 $
00007   Version:   $Revision: 1.13 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/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 #ifndef __itkCellInterfaceVisitor_h
00018 #define __itkCellInterfaceVisitor_h
00019 
00020 #include "itkLightObject.h"
00021 #include "itkObjectFactory.h"
00022 
00023 namespace itk
00024 {
00025 // forward reference CellInterface
00026 template <
00027   typename TPixelType,
00028   typename TCellTraits
00029 > 
00030 class CellInterface;
00031   
00041 template <
00042   typename TPixelType,
00043   typename TCellTraits
00044 >  
00045 class CellInterfaceVisitor : public LightObject
00046 {
00047 public: 
00049   typedef CellInterfaceVisitor      Self;
00050   typedef LightObject               Superclass;
00051   typedef SmartPointer<Self>        Pointer;
00052   typedef SmartPointer<const Self>  ConstPointer;
00053 
00055   itkTypeMacro(CellInterfaceVisitor,LightObject);
00056 
00058   virtual void VisitFromCell(unsigned long cellId, CellInterface<TPixelType, 
00059                                                            TCellTraits>*) = 0;
00060 
00062   virtual int GetCellTopologyId() = 0;
00063 
00064 protected:
00065   CellInterfaceVisitor() {};
00066   ~CellInterfaceVisitor() {};
00067 
00068 private:
00069   CellInterfaceVisitor(const Self&); //purposely not implemented
00070   void operator=(const Self&); //purposely not implemented
00071 };
00072 
00073   
00097 template<
00098 typename TPixelType,
00099   typename TCellTraits,
00100   class CellTopology,
00101   class UserVisitor 
00102 >
00103 class CellInterfaceVisitorImplementation : 
00104     public CellInterfaceVisitor<TPixelType, TCellTraits>, public UserVisitor
00105 {
00106 public:
00108   typedef CellInterfaceVisitorImplementation   Self;
00109   typedef SmartPointer<Self>                   Pointer;
00110 
00112   itkNewMacro(Self);
00113 
00115   itkTypeMacro(CellInterfaceVisitorImplementation,LightObject);
00116 
00119   virtual int GetCellTopologyId() { return CellTopology::GetTopologyId();}
00120 
00123   void VisitFromCell(unsigned long cellId, CellInterface<TPixelType, 
00124                                                          TCellTraits>* c)
00125     {
00126     this->UserVisitor::Visit(cellId, (CellTopology*)c);
00127     }
00128 
00129 protected:
00130   CellInterfaceVisitorImplementation() {};
00131   ~CellInterfaceVisitorImplementation() {};
00132 
00133 private:
00134   CellInterfaceVisitorImplementation(const Self&); //purposely not implemented
00135   void operator=(const Self&); //purposely not implemented
00136   
00137 };
00138 
00139 } // end namespace itk
00140 
00141 #endif
00142 

Generated at Thu May 28 09:33:58 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000