ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 #ifndef __itkSphereMeshSource_h 00019 #define __itkSphereMeshSource_h 00020 00021 #include "vnl/vnl_matrix_fixed.h" 00022 #include "itkMesh.h" 00023 #include "itkMeshSource.h" 00024 #include "itkVector.h" 00025 #include "itkTriangleCell.h" 00026 #include "itkDefaultStaticMeshTraits.h" 00027 00028 namespace itk 00029 { 00040 template< class TOutputMesh > 00041 class ITK_EXPORT SphereMeshSource:public MeshSource< TOutputMesh > 00042 { 00043 public: 00045 typedef SphereMeshSource Self; 00046 typedef MeshSource< TOutputMesh > Superclass; 00047 typedef SmartPointer< Self > Pointer; 00048 typedef SmartPointer< const Self > ConstPointer; 00049 00051 itkNewMacro(Self); 00052 00054 itkTypeMacro(SphereMeshSource, MeshSource); 00055 00057 typedef TOutputMesh OutputMeshType; 00058 typedef typename OutputMeshType::MeshTraits OMeshTraits; 00059 typedef typename OutputMeshType::PointType OPointType; 00060 typedef typename OMeshTraits::PixelType OPixelType; 00061 00063 typedef typename OutputMeshType::Pointer OutputMeshPointer; 00064 typedef typename OutputMeshType::CellTraits CellTraits; 00065 typedef typename OutputMeshType::PointsContainerPointer PointsContainerPointer; 00066 typedef typename OutputMeshType::PointsContainer PointsContainer; 00067 00070 typedef CellInterface< OPixelType, CellTraits > CellInterfaceType; 00071 typedef TriangleCell< CellInterfaceType > TriCellType; 00072 typedef typename TriCellType::SelfAutoPointer TriCellAutoPointer; 00073 typedef typename TriCellType::CellAutoPointer CellAutoPointer; 00074 00077 itkSetMacro(ResolutionX, unsigned int); 00078 itkSetMacro(ResolutionY, unsigned int); 00080 00081 itkSetMacro(Center, OPointType); 00082 itkSetMacro(Scale, OPointType); 00083 00084 itkSetMacro(Squareness1, double); 00085 itkSetMacro(Squareness2, double); 00086 protected: 00087 SphereMeshSource(); 00088 ~SphereMeshSource() {} 00089 void PrintSelf(std::ostream & os, Indent indent) const; 00090 00091 void GenerateData(); 00092 00094 OPointType m_Center; 00095 00097 unsigned int m_ResolutionX; 00098 unsigned int m_ResolutionY; 00099 00101 OPointType m_Scale; 00102 00103