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: 2004/07/27 16:06:20 $
00007   Version:   $Revision: 1.4 $
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);
00082 
00084   itkSetMacro( Center, PointType  );
00085   itkGetMacro( Center, PointType  );
00086 
00090   itkSetMacro( Scale,  VectorType );
00091   itkGetMacro( Scale,  VectorType );
00092 
00093 protected:
00094   RegularSphereMeshSource();
00095   ~RegularSphereMeshSource() {}
00096   void PrintSelf(std::ostream& os, itk::Indent indent) const;
00097 
00098   void GenerateData();
00099 
00100   PointType Divide( const PointType & p1, const PointType & p2) const;
00101 
00102   void AddCell( OutputMeshType * mesh, const unsigned long * pointIds, unsigned long idx);
00103 
00105   PointType m_Center; 
00106 
00108   unsigned int m_Resolution;
00109 
00111   VectorType m_Scale;
00112   
00113 
00114 private:
00115   RegularSphereMeshSource(const Self&); //purposely not implemented
00116   void operator=(const Self&); //purposely not implemented
00117 };
00118 
00119 
00120 
00121 } // end namespace itk
00122 
00123 #include "itkRegularSphereMeshSource.txx"
00124 
00125 #endif //_itkRegularSphereMeshSource_H

Generated at Wed May 24 23:58:22 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000