ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkTetrahedronCell.h
Go to the documentation of this file.
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 __itkTetrahedronCell_h
00019 #define __itkTetrahedronCell_h
00020 
00021 #include "itkTriangleCell.h"
00022 #include "itkTetrahedronCellTopology.h"
00023 
00024 namespace itk
00025 {
00036 template< typename TCellInterface >
00037 class ITK_EXPORT TetrahedronCell:public TCellInterface, private TetrahedronCellTopology
00038 {
00039 public:
00041   itkCellCommonTypedefs(TetrahedronCell);
00042   itkCellInheritedTypedefs(TCellInterface);
00044 
00046   itkTypeMacro(TetrahedronCell, CellInterface);
00047 
00049   typedef VertexCell< TCellInterface >         VertexType;
00050   typedef typename VertexType::SelfAutoPointer VertexAutoPointer;
00051 
00053   typedef LineCell< TCellInterface >         EdgeType;
00054   typedef typename EdgeType::SelfAutoPointer EdgeAutoPointer;
00055 
00057   typedef TriangleCell< TCellInterface >     FaceType;
00058   typedef typename FaceType::SelfAutoPointer FaceAutoPointer;
00059 
00061   itkStaticConstMacro(NumberOfPoints, unsigned int, 4);
00062   itkStaticConstMacro(NumberOfVertices, unsigned int, 4);
00063   itkStaticConstMacro(NumberOfEdges, unsigned int, 6);
00064   itkStaticConstMacro(NumberOfFaces, unsigned int, 4);
00065   itkStaticConstMacro(CellDimension, unsigned int, 3);
00067 
00069   virtual CellGeometry GetType(void) const
00070   { return Superclass::TETRAHEDRON_CELL; }
00071   virtual void MakeCopy(CellAutoPointer &) const;
00073 
00074   virtual unsigned int GetDimension(void) const;
00075 
00076   virtual unsigned int GetNumberOfPoints(void) const;
00077 
00078   virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
00079 
00080   virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier,
00081                                   CellAutoPointer &);
00082   virtual void SetPointIds(PointIdConstIterator first);
00083 
00084   virtual void SetPointIds(PointIdConstIterator first,
00085                            PointIdConstIterator last);
00086 
00087   virtual void SetPointId(int localId, PointIdentifier);
00088   virtual PointIdIterator      PointIdsBegin(void);
00089 
00090   virtual PointIdConstIterator PointIdsBegin(void) const;
00091 
00092   virtual PointIdIterator      PointIdsEnd(void);
00093 
00094   virtual PointIdConstIterator PointIdsEnd(void) const;
00095 
00097   virtual CellFeatureCount GetNumberOfVertices(void) const;
00098 
00099   virtual CellFeatureCount GetNumberOfEdges(void) const;
00100 
00101   virtual CellFeatureCount GetNumberOfFaces(void) const;
00102 
00103   virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
00104   virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
00105   virtual bool GetFace(CellFeatureIdentifier, FaceAutoPointer &);
00106 
00108   itkCellVisitMacro(Superclass::TETRAHEDRON_CELL);
00109 
00110   virtual bool EvaluatePosition(CoordRepType *,
00111                                 PointsContainer *,
00112                                 CoordRepType *,
00113                                 CoordRepType[],
00114                                 double *,
00115                                 InterpolationWeightType *);
00116 public:
00117   TetrahedronCell()
00118   {
00119     for ( PointIdentifier i = 0; i < itkGetStaticConstMacro(NumberOfPoints); i++ )
00120       {
00121       m_PointIds[i] = NumericTraits< PointIdentifier >::max();
00122       }
00123   }
00124 
00125   ~TetrahedronCell() {}
00126 protected:
00128   PointIdentifier m_PointIds[NumberOfPoints];
00129 private:
00130   TetrahedronCell(const Self &); //purposely not implemented
00131   void operator=(const Self &);  //purposely not implemented
00132 };
00133 } // end namespace itk
00135 
00136 #ifndef ITK_MANUAL_INSTANTIATION
00137 #include "itkTetrahedronCell.hxx"
00138 #endif
00139 
00140 #endif
00141