| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkTetrahedronCell.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:48 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 13 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
|
PURPOSE. See the above copyright notices for more information. |
| 15 |
|
|
| 16 |
|
=========================================================================*/ |
| 17 |
|
#ifndef __itkTetrahedronCell_h |
| 18 |
|
#define __itkTetrahedronCell_h |
| 19 |
|
|
| 20 |
|
#include "itkCellInterface.h" |
| 21 |
|
#include "itkTriangleCell.h" |
| 22 |
|
#include "itkTetrahedronCellTopology.h" |
| 23 |
|
|
| 24 |
|
namespace itk |
| 25 |
|
{ |
| 26 |
|
|
| 27 |
|
/** \class TetrahedronCell |
| 28 |
|
* TetrahedronCell represents a tetrahedron for a Mesh. |
| 29 |
|
* |
| 30 |
|
* Template parameters for TetrahedronCell: |
| 31 |
|
* |
| 32 |
|
* TPixelType = |
| 33 |
|
* The type associated with a point, cell, or boundary for use in storing |
| 34 |
|
* its data. |
| 35 |
|
* |
| 36 |
|
* TCellTraits = |
| 37 |
|
* Type information of mesh containing cell. |
| 38 |
|
* \ingroup MeshObjects |
| 39 |
|
*/ |
| 40 |
|
template < typename TCellInterface > |
| 41 |
LEN |
class ITK_EXPORT TetrahedronCell: public TCellInterface, private TetrahedronCellTopology |
| 42 |
|
{ |
| 43 |
|
public: |
| 44 |
|
/** Standard class typedefa. */ |
| 45 |
|
itkCellCommonTypedefs(TetrahedronCell); |
| 46 |
|
itkCellInheritedTypedefs(TCellInterface); |
| 47 |
|
|
| 48 |
|
/** Standard part of every itk Object. */ |
| 49 |
|
itkTypeMacro(TetrahedronCell, CellInterface); |
| 50 |
|
|
| 51 |
|
/** The type of boundary for this triangle's vertices. */ |
| 52 |
|
typedef VertexCell< TCellInterface > VertexType; |
| 53 |
|
typedef typename VertexType::SelfAutoPointer VertexAutoPointer; |
| 54 |
|
|
| 55 |
|
/** The type of boundary for this triangle's edges. */ |
| 56 |
|
typedef LineCell< TCellInterface > EdgeType; |
| 57 |
|
typedef typename EdgeType::SelfAutoPointer EdgeAutoPointer; |
| 58 |
|
|
| 59 |
|
/** The type of boundary for this hexahedron's faces. */ |
| 60 |
|
typedef TriangleCell< TCellInterface > FaceType; |
| 61 |
|
typedef typename FaceType::SelfAutoPointer FaceAutoPointer; |
| 62 |
|
|
| 63 |
|
/** Tetrahedron-specific topology numbers. */ |
| 64 |
|
itkStaticConstMacro(NumberOfPoints, unsigned int, 4); |
| 65 |
|
itkStaticConstMacro(NumberOfVertices, unsigned int, 4); |
| 66 |
|
itkStaticConstMacro(NumberOfEdges, unsigned int, 6); |
| 67 |
|
itkStaticConstMacro(NumberOfFaces, unsigned int, 4); |
| 68 |
|
itkStaticConstMacro(CellDimension, unsigned int, 3); |
| 69 |
|
|
| 70 |
|
/** Implement the standard CellInterface. */ |
| 71 |
|
virtual CellGeometry GetType(void) const |
| 72 |
|
{return Superclass::TETRAHEDRON_CELL;} |
| 73 |
|
virtual void MakeCopy( CellAutoPointer & ) const; |
| 74 |
|
virtual unsigned int GetDimension(void) const; |
| 75 |
|
virtual unsigned int GetNumberOfPoints(void) const; |
| 76 |
|
virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const; |
| 77 |
|
virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, |
| 78 |
|
CellAutoPointer &); |
| 79 |
|
virtual void SetPointIds(PointIdConstIterator first); |
| 80 |
|
virtual void SetPointIds(PointIdConstIterator first, |
| 81 |
|
PointIdConstIterator last); |
| 82 |
|
virtual void SetPointId(int localId, PointIdentifier); |
| 83 |
|
virtual PointIdIterator PointIdsBegin(void); |
| 84 |
|
virtual PointIdConstIterator PointIdsBegin(void) const; |
| 85 |
|
virtual PointIdIterator PointIdsEnd(void); |
| 86 |
|
virtual PointIdConstIterator PointIdsEnd(void) const; |
| 87 |
|
|
| 88 |
|
/** Tetrahedron-specific interface. */ |
| 89 |
|
virtual CellFeatureCount GetNumberOfVertices(void) const; |
| 90 |
|
virtual CellFeatureCount GetNumberOfEdges(void) const; |
| 91 |
|
virtual CellFeatureCount GetNumberOfFaces(void) const; |
| 92 |
|
virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &); |
| 93 |
|
virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &); |
| 94 |
|
virtual bool GetFace(CellFeatureIdentifier, FaceAutoPointer &); |
| 95 |
|
|
| 96 |
|
/** Visitor interface. */ |
| 97 |
|
itkCellVisitMacro(Superclass::TETRAHEDRON_CELL); |
| 98 |
|
|
| 99 |
|
virtual bool EvaluatePosition(CoordRepType* , |
| 100 |
|
PointsContainer* , |
| 101 |
|
CoordRepType* , |
| 102 |
|
CoordRepType [], |
| 103 |
|
double *, |
| 104 |
|
InterpolationWeightType*); |
| 105 |
|
|
| 106 |
IND |
*public: |
| 107 |
|
TetrahedronCell() {} |
| 108 |
|
~TetrahedronCell() {} |
| 109 |
|
|
| 110 |
IND |
*protected: |
| 111 |
|
/** Store the number of points needed for a tetrahedron. */ |
| 112 |
|
PointIdentifier m_PointIds[NumberOfPoints]; |
| 113 |
|
|
| 114 |
IND |
*private: |
| 115 |
|
TetrahedronCell(const Self&); //purposely not implemented |
| 116 |
|
void operator=(const Self&); //purposely not implemented |
| 117 |
|
|
| 118 |
IND |
**}; |
| 119 |
|
|
| 120 |
|
} // end namespace itk |
| 121 |
|
|
| 122 |
|
#ifndef ITK_MANUAL_INSTANTIATION |
| 123 |
|
#include "itkTetrahedronCell.txx" |
| 124 |
|
#endif |
| 125 |
|
|
| 126 |
|
#endif |
| 127 |
|
|