00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSphereMeshSource.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/08/13 19:46:10 $ 00007 Version: $Revision: 1.11 $ 00008 00009 Copyright (c) 2002 Insight 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 __itkSphereMeshSource_h 00018 #define __itkSphereMeshSource_h 00019 00020 #include "vnl/vnl_matrix_fixed.h" 00021 #include "itkMesh.h" 00022 #include "itkMeshSource.h" 00023 #include "itkVector.h" 00024 #include "itkTriangleCell.h" 00025 #include "itkDefaultStaticMeshTraits.h" 00026 00027 namespace itk 00028 { 00029 00041 template <class TOutputMesh> 00042 class ITK_EXPORT SphereMeshSource : public MeshSource<TOutputMesh> 00043 { 00044 public: 00046 typedef SphereMeshSource Self; 00047 typedef MeshSource<TOutputMesh> Superclass; 00048 typedef SmartPointer<Self> Pointer; 00049 typedef SmartPointer<const Self> ConstPointer; 00050 00052 itkNewMacro(Self); 00053 00055 itkTypeMacro(SphereMeshSource, MeshSource); 00056 00058 typedef TOutputMesh OutputMeshType; 00059 typedef typename OutputMeshType::MeshTraits OMeshTraits; 00060 typedef typename OutputMeshType::PointType OPointType; 00061 typedef typename OMeshTraits::PixelType OPixelType; 00062 00064 typedef typename OutputMeshType::Pointer OutputMeshPointer; 00065 typedef typename OutputMeshType::CellTraits CellTraits; 00066 typedef typename OutputMeshType::PointsContainerPointer PointsContainerPointer; 00067 typedef typename OutputMeshType::PointsContainer PointsContainer; 00068 typedef typename OutputMeshType::CellsContainerPointer CellsContainerPointer; 00069 typedef typename OutputMeshType::CellsContainer CellsContainer; 00070 typedef typename OutputMeshType::CellDataContainerPointer CellDataContainerPointer; 00071 typedef typename OutputMeshType::CellDataContainer CellDataContainer; 00072 00075 typedef CellInterface<OPixelType, CellTraits> CellInterfaceType; 00076 typedef TriangleCell<CellInterfaceType> TriCellType; 00077 typedef typename TriCellType::Pointer TriCellPointer; 00078 00079 itkSetMacro(ResolutionX, unsigned int); 00080 itkSetMacro(ResolutionY, unsigned int); 00081 00082 itkSetMacro(Center, OPointType); 00083 itkSetMacro(Scale, OPointType); 00084 00085 itkSetMacro(Squareness1, double); 00086 itkSetMacro(Squareness2, double); 00087 00088 protected: 00089 SphereMeshSource(); 00090 ~SphereMeshSource() {}; 00091 void PrintSelf(std::ostream& os, Indent indent) const; 00092 00093 void GenerateData(); 00094 00095 private: 00096 SphereMeshSource(const Self&); //purposely not implemented 00097 void operator=(const Self&); //purposely not implemented 00098 00100 OPointType m_Center; 00101 00103 unsigned int m_ResolutionX; 00104 00105 unsigned int m_ResolutionY; 00106 00108 OPointType m_Scale; 00109 00111 double m_Squareness1; 00112 double m_Squareness2; 00113 00114 }; 00115 00116 } // end namespace itk 00117 #ifndef ITK_MANUAL_INSTANTIATION 00118 #include "itkSphereMeshSource.txx" 00119 #endif 00120 #endif