14 #ifndef __itkSphereTessellator_h 15 #define __itkSphereTessellator_h 17 #include <itkObject.h> 18 #include <itkObjectFactory.h> 19 #include <vnl/vnl_matrix.h> 20 #include <vnl/vnl_vector.h> 36 template <
typename TElement =
double>
53 const static unsigned int NDimensions = 3;
60 void TessellateSphere();
65 itkGetMacro(BasicShape, BasicShapeType);
66 itkSetMacro(BasicShape, BasicShapeType);
70 itkGetMacro(Order,
unsigned int);
71 itkSetMacro(Order,
unsigned int);
74 itkGetMacro(NumberOfVertices,
unsigned int);
75 itkGetMacro(NumberOfFaces,
unsigned int);
76 itkGetMacro(NumberOfEdges,
unsigned int);
85 PointsMatrixType points(m_Points.rows()/2, 3);
87 for (
int i = 0; i < m_NumberOfVertices; i += 1 )
90 || (
std::abs(points(i,2))<1e-20 && points(i,1)<0)
91 || (
std::abs(points(i,2))<1e-20 &&
std::abs(points(i,1))<1e-20 && points(i,0)>0))
93 for (
int kk = 0; kk < 3; ++kk )
94 points(j,3) = m_Points(i,3);
107 void Initialize(
void);
122 void PrintSelf(std::ostream& os, Indent indent)
const ITK_OVERRIDE;
124 void InitTetrahedron();
125 void InitOctahedron();
126 void InitIcosahedron();
127 int SearchMidpoint (
int index_start,
int index_end);
133 void operator=(
const Self&);
162 #define ITK_TEMPLATE_SphereTessellator(_, EXPORT, x, y) namespace itk { \ 163 _(2(class EXPORT SphereTessellator< ITK_TEMPLATE_2 x >)) \ 164 namespace Templates { typedef SphereTessellator< ITK_TEMPLATE_2 x > SphereTessellator##y; } \ 167 #if ITK_TEMPLATE_EXPLICIT 168 # include "Templates/itkSphereTessellator+-.h" 171 #if !defined(ITK_MANUAL_INSTANTIATION) && !defined(__itkSphereTessellator_hxx)
PointsMatrixType GetPointsMatrix()
vnl_matrix< unsigned long > CellsMatrixType
PointsMatrixType m_Points
unsigned int m_NumberOfFaces
CellsMatrixType GetCellsMatrix()
unsigned int m_NumberOfVertices
unsigned int m_NumberOfEdges
T abs(const T x)
template version of the fabs function
vnl_matrix< TElement > PointsMatrixType
BasicShapeType m_BasicShape
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
PointsMatrixType GetPointsMatrixInHemisphere()
Tesselates a sphere via subdivision of tetrahedron, octahedron, or icosahedron.