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: 2009-05-12 17:26:21 $
00007   Version:   $Revision: 1.8 $
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 ITK_EXPORT 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   itkGetConstMacro(Resolution, unsigned int);
00083 
00085   itkSetMacro( Center, PointType  );
00086   itkGetConstMacro( Center, PointType  );
00088 
00092   itkSetMacro( Scale,  VectorType );
00093   itkGetConstMacro( 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 } // end namespace itk
00123 
00124 #ifndef ITK_MANUAL_INSTANTIATION
00125 #include "itkRegularSphereMeshSource.txx"
00126 #endif
00127 
00128 #endif //_itkRegularSphereMeshSource_h
00129 

Generated at Mon Jul 12 2010 19:40:37 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000