00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSphereMeshSource.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/12/01 20:13:50 $ 00007 Version: $Revision: 1.13 $ 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 00039 template <class TOutputMesh> 00040 class ITK_EXPORT SphereMeshSource : public MeshSource<TOutputMesh> 00041 { 00042 public: 00044 typedef SphereMeshSource Self; 00045 typedef MeshSource<TOutputMesh> Superclass; 00046 typedef SmartPointer<Self> Pointer; 00047 typedef SmartPointer<const Self> ConstPointer; 00048 00050 itkNewMacro(Self); 00051 00053 itkTypeMacro(SphereMeshSource, MeshSource); 00054 00056 typedef TOutputMesh OutputMeshType; 00057 typedef typename OutputMeshType::MeshTraits OMeshTraits; 00058 typedef typename OutputMeshType::PointType OPointType; 00059 typedef typename OMeshTraits::PixelType OPixelType; 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 00069 typedef CellInterface<OPixelType, CellTraits> CellInterfaceType; 00070 typedef TriangleCell<CellInterfaceType> TriCellType; 00071 typedef typename TriCellType::SelfAutoPointer TriCellAutoPointer; 00072 typedef typename TriCellType::CellAutoPointer CellAutoPointer; 00073 00076 itkSetMacro(ResolutionX, unsigned int); 00077 itkSetMacro(ResolutionY, unsigned int); 00078 00079 itkSetMacro(Center, OPointType); 00080 itkSetMacro(Scale, OPointType); 00081 00082 itkSetMacro(Squareness1, double); 00083 itkSetMacro(Squareness2, double); 00084 00085 protected: 00086 SphereMeshSource(); 00087 ~SphereMeshSource() {} 00088 void PrintSelf(std::ostream& os, Indent indent) const; 00089 00090 void GenerateData(); 00091 00093 OPointType m_Center; 00094 00096 unsigned int m_ResolutionX; 00097 unsigned int m_ResolutionY; 00098 00100 OPointType m_Scale; 00101 00103 double m_Squareness1; 00104 double m_Squareness2; 00105 00106 private: 00107 SphereMeshSource(const Self&); //purposely not implemented 00108 void operator=(const Self&); //purposely not implemented 00109 }; 00110 00111 } // end namespace itk 00112 #ifndef ITK_MANUAL_INSTANTIATION 00113 #include "itkSphereMeshSource.txx" 00114 #endif 00115 #endif