KWStyle - itkHexahedronCell.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkHexahedronCell.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:36 $
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 __itkHexahedronCell_h
18 #define __itkHexahedronCell_h
19
20 #include "itkCellInterface.h"
21 #include "itkQuadrilateralCell.h"
22 #include "itkHexahedronCellTopology.h"
23
24 namespace itk
25 {
26
27 /** \class HexahedronCell
28  * HexahedronCell represents a hexahedron for a Mesh.
29  *
30  * Template parameters for HexahedronCell:
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  *
39  * \ingroup MeshObjects
40  */
41
42 template < typename TCellInterface >
43 LEN class ITK_EXPORT HexahedronCell: public TCellInterface, private HexahedronCellTopology
44 {
45 public:
46   /** Standard class typedefs. */
47   itkCellCommonTypedefs(HexahedronCell);
48   itkCellInheritedTypedefs(TCellInterface);
49
50   /** Standard part of every itk Object. */
51   itkTypeMacro(HexahedronCell, CellInterface);
52
53   /** The type of boundary for this triangle's vertices. */
54   typedef VertexCell< TCellInterface >            VertexType;
55   typedef typename VertexType::SelfAutoPointer    VertexAutoPointer;
56   
57   /** The type of boundary for this triangle's edges. */
58   typedef LineCell< TCellInterface >              EdgeType;
59   typedef typename EdgeType::SelfAutoPointer      EdgeAutoPointer;
60   
61   /** The type of boundary for this hexahedron's faces. */
62   typedef QuadrilateralCell< TCellInterface >     FaceType;
63   typedef typename FaceType::SelfAutoPointer      FaceAutoPointer;
64     
65   /** Hexahedron-specific topology numbers. */
66   enum { NumberOfPoints   =  8,
67 IND *********NumberOfVertices =  8,
68 IND *********NumberOfEdges    = 12,
69 IND *********NumberOfFaces    =  6,
70 IND *********CellDimension    =  3 };
71
72   /** Implement the standard CellInterface. */
73   virtual CellGeometry GetType(void) const 
74     {return Superclass::HEXAHEDRON_CELL;}
75   virtual void MakeCopy( CellAutoPointer & ) const;
76   virtual unsigned int GetDimension(void) const;
77   virtual unsigned int GetNumberOfPoints(void) const;
78   virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
79 LEN   virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &);
80   virtual void SetPointIds(PointIdConstIterator first);
81 LEN   virtual void SetPointIds(PointIdConstIterator first, 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   /** Hexahedron-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   /** Evaluate the position inside the cell */
97   virtual bool EvaluatePosition(CoordRepType* ,
98                                 PointsContainer* ,
99                                 CoordRepType* ,
100                                 CoordRepType [],
101                                 double *,
102                                 InterpolationWeightType*);
103
104   /** Visitor interface */
105   itkCellVisitMacro(Superclass::HEXAHEDRON_CELL);
106
107 protected:
108   /** Store the number of points needed for a hexahedron. */
109   PointIdentifier m_PointIds[NumberOfPoints];
110
111   void InterpolationDerivs(CoordRepType pcoords[3], CoordRepType derivs[24]);
112   void InterpolationFunctions(CoordRepType pcoords[3], CoordRepType sf[8]);
113 LEN   void EvaluateLocation(int& itkNotUsed(subId), PointsContainer* points, CoordRepType pcoords[3],
114 IND *************************************CoordRepType x[3], CoordRepType *weights);
115   
116 public:
117   HexahedronCell() {}
118   ~HexahedronCell() {}
119   
120 private:
121   HexahedronCell(const Self&); //purposely not implemented
122   void operator=(const Self&); //purposely not implemented  
123 };
124
125 // end namespace itk
126
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "itkHexahedronCell.txx"
129 #endif
130
131 #endif
132

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:11PM
© Kitware Inc.