Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkHexahedronCell.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkHexahedronCell.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/05/18 14:31:11 $
00007   Version:   $Revision: 1.49 $
00008 
00009   Copyright (c) Insight Software 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 __itkHexahedronCell_h
00018 #define __itkHexahedronCell_h
00019 
00020 #include "itkCellInterface.h"
00021 #include "itkQuadrilateralCell.h"
00022 #include "itkHexahedronCellTopology.h"
00023 
00024 namespace itk
00025 {
00026 
00042 template < typename TCellInterface >
00043 class ITK_EXPORT HexahedronCell: public TCellInterface, private HexahedronCellTopology
00044 {
00045 public:
00047   itkCellCommonTypedefs(HexahedronCell);
00048   itkCellInheritedTypedefs(TCellInterface);
00050 
00052   itkTypeMacro(HexahedronCell, CellInterface);
00053 
00055   typedef VertexCell< TCellInterface >            VertexType;
00056   typedef typename VertexType::SelfAutoPointer    VertexAutoPointer;
00057 
00059   typedef LineCell< TCellInterface >              EdgeType;
00060   typedef typename EdgeType::SelfAutoPointer      EdgeAutoPointer;
00061 
00063   typedef QuadrilateralCell< TCellInterface >     FaceType;
00064   typedef typename FaceType::SelfAutoPointer      FaceAutoPointer;
00065 
00067   enum { NumberOfPoints   =  8,
00068          NumberOfVertices =  8,
00069          NumberOfEdges    = 12,
00070          NumberOfFaces    =  6,
00071          CellDimension    =  3 };
00072 
00074   virtual CellGeometry GetType(void) const 
00075     {return Superclass::HEXAHEDRON_CELL;}
00076   virtual void MakeCopy( CellAutoPointer & ) const;
00077   virtual unsigned int GetDimension(void) const;
00078   virtual unsigned int GetNumberOfPoints(void) const;
00079   virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
00080   virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &);
00081   virtual void SetPointIds(PointIdConstIterator first);
00082   virtual void SetPointIds(PointIdConstIterator first, PointIdConstIterator last);
00083   virtual void SetPointId(int localId, PointIdentifier);
00084   virtual PointIdIterator      PointIdsBegin(void);
00085   virtual PointIdConstIterator PointIdsBegin(void) const;
00086   virtual PointIdIterator      PointIdsEnd(void);
00087   virtual PointIdConstIterator PointIdsEnd(void) const; 
00089 
00091   virtual CellFeatureCount GetNumberOfVertices(void) const;
00092   virtual CellFeatureCount GetNumberOfEdges(void) const;
00093   virtual CellFeatureCount GetNumberOfFaces(void) const;
00094   virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
00095   virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);  
00096   virtual bool GetFace(CellFeatureIdentifier, FaceAutoPointer &);  
00098 
00100   virtual bool EvaluatePosition(CoordRepType* ,
00101                                 PointsContainer* ,
00102                                 CoordRepType* ,
00103                                 CoordRepType [],
00104                                 double *,
00105                                 InterpolationWeightType*);
00106 
00108   itkCellVisitMacro(Superclass::HEXAHEDRON_CELL);
00109 
00110 protected:
00112   PointIdentifier m_PointIds[NumberOfPoints];
00113 
00114   void InterpolationDerivs(CoordRepType pcoords[3], CoordRepType derivs[24]);
00115   void InterpolationFunctions(CoordRepType pcoords[3], InterpolationWeightType sf[8]);
00116   void EvaluateLocation(int& itkNotUsed(subId), PointsContainer* points, CoordRepType pcoords[3],
00117                                      CoordRepType x[3], InterpolationWeightType *weights);
00118   
00119 public:
00120   HexahedronCell()
00121     {
00122     for (unsigned int i = 0; i < itkGetStaticConstMacro(NumberOfPoints); i++)
00123       {
00124       m_PointIds[i] = NumericTraits<unsigned long>::max();
00125       }
00126     }
00127   ~HexahedronCell() {}
00128   
00129 private:
00130   HexahedronCell(const Self&); //purposely not implemented
00131   void operator=(const Self&); //purposely not implemented  
00132 };
00133 
00134 } // end namespace itk
00135 
00136 #ifndef ITK_MANUAL_INSTANTIATION
00137 #include "itkHexahedronCell.txx"
00138 #endif
00139 
00140 #endif
00141 

Generated at Sun Sep 23 12:49:38 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000