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

itkRegularSphereMeshSource.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRegularSphereMeshSource.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/02/05 20:57:46 $
00007   Version:   $Revision: 1.5 $
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 __itkRegularSphereMeshSource_h
00018 #define __itkRegularSphereMeshSource_h
00019 
00020 #include "itkMesh.h"
00021 #include "itkMeshSource.h"
00022 #include "itkTriangleCell.h"
00023 #include "itkMapContainer.h"
00024 
00025 namespace itk
00026 {
00027 
00039 template <class TOutputMesh>
00040 class RegularSphereMeshSource : public MeshSource<TOutputMesh>
00041 {
00042 public:
00044   typedef RegularSphereMeshSource         Self;
00045   typedef itk::MeshSource<TOutputMesh>  Superclass;
00046   typedef itk::SmartPointer<Self>  Pointer;
00047   typedef itk::SmartPointer<const Self>  ConstPointer;
00048 
00050   itkNewMacro(Self);  
00051 
00053   itkTypeMacro(RegularSphereMeshSource, MeshSource);
00054 
00056   typedef TOutputMesh OutputMeshType;
00057   typedef typename OutputMeshType::MeshTraits   MeshTraits;
00058   typedef typename OutputMeshType::PointType    PointType;
00059   typedef typename MeshTraits::PixelType        PixelType;  
00060 
00062   typedef typename OutputMeshType::Pointer OutputMeshPointer;
00063   typedef typename OutputMeshType::CellTraits CellTraits;
00064   typedef typename OutputMeshType::PointsContainerPointer PointsContainerPointer;
00065   typedef typename OutputMeshType::PointsContainer   PointsContainer;
00066 
00068   typedef itk::CellInterface<PixelType, CellTraits>   CellInterfaceType;
00069   typedef itk::TriangleCell<CellInterfaceType>         TriCellType;
00070   typedef typename TriCellType::SelfAutoPointer       TriCellAutoPointer;
00071   typedef typename TriCellType::CellAutoPointer       CellAutoPointer;
00072 
00073   typedef std::pair<unsigned long,unsigned long> IndexPairType;
00074   typedef itk::MapContainer<IndexPairType, unsigned long> PointMapType;
00075   typedef typename PointType::VectorType VectorType;
00076     
00077 
00080   itkSetMacro(Resolution, unsigned int);
00081   itkGetMacro(Resolution, unsigned int);
00083 
00085   itkSetMacro( Center, PointType  );
00086   itkGetMacro( Center, PointType  );
00088 
00092   itkSetMacro( Scale,  VectorType );
00093   itkGetMacro( Scale,  VectorType );
00095 
00096 protected:
00097   RegularSphereMeshSource();
00098   ~RegularSphereMeshSource() {}
00099   void PrintSelf(std::ostream& os, itk::Indent indent) const;
00100 
00101   void GenerateData();
00102 
00103   PointType Divide( const PointType & p1, const PointType & p2) const;
00104 
00105   void AddCell( OutputMeshType * mesh, const unsigned long * pointIds, unsigned long idx);
00106 
00108   PointType m_Center; 
00109 
00111   unsigned int m_Resolution;
00112 
00114   VectorType m_Scale;
00115 
00116 
00117 private:
00118   RegularSphereMeshSource(const Self&); //purposely not implemented
00119   void operator=(const Self&); //purposely not implemented
00120 };
00121 
00122 
00123 
00124 } // end namespace itk
00125 
00126 #ifndef ITK_MANUAL_INSTANTIATION
00127 #include "itkRegularSphereMeshSource.txx"
00128 #endif
00129 
00130 #endif //_itkRegularSphereMeshSource_h
00131 

Generated at Tue Jul 29 22:03:42 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000