ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkHexahedronCell.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkHexahedronCell_h
19 #define itkHexahedronCell_h
20 
21 #include "itkQuadrilateralCell.h"
23 
24 namespace itk
25 {
43 template< typename TCellInterface >
44 class HexahedronCell:public TCellInterface, private HexahedronCellTopology
45 {
46 public:
49  itkCellInheritedTypedefs(TCellInterface);
51 
53  itkTypeMacro(HexahedronCell, CellInterface);
54 
57  typedef typename VertexType::SelfAutoPointer VertexAutoPointer;
58 
61  typedef typename EdgeType::SelfAutoPointer EdgeAutoPointer;
62 
65  typedef typename FaceType::SelfAutoPointer FaceAutoPointer;
66 
68  enum { NumberOfPoints = 8,
73 
75  virtual CellGeometry GetType(void) const ITK_OVERRIDE
76  { return Superclass::HEXAHEDRON_CELL; }
77  virtual void MakeCopy(CellAutoPointer &) const ITK_OVERRIDE;
79 
80  virtual unsigned int GetDimension(void) const ITK_OVERRIDE;
81 
82  virtual unsigned int GetNumberOfPoints(void) const ITK_OVERRIDE;
83 
84  virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const ITK_OVERRIDE;
85 
86  virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) ITK_OVERRIDE;
87  virtual void SetPointIds(PointIdConstIterator first) ITK_OVERRIDE;
88 
89  virtual void SetPointIds(PointIdConstIterator first, PointIdConstIterator last) ITK_OVERRIDE;
90 
91  virtual void SetPointId(int localId, PointIdentifier) ITK_OVERRIDE;
92  virtual PointIdIterator PointIdsBegin(void) ITK_OVERRIDE;
93 
94  virtual PointIdConstIterator PointIdsBegin(void) const ITK_OVERRIDE;
95 
96  virtual PointIdIterator PointIdsEnd(void) ITK_OVERRIDE;
97 
98  virtual PointIdConstIterator PointIdsEnd(void) const ITK_OVERRIDE;
99 
101  virtual CellFeatureCount GetNumberOfVertices() const;
102 
103  virtual CellFeatureCount GetNumberOfEdges() const;
104 
105  virtual CellFeatureCount GetNumberOfFaces() const;
106 
107  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
108  virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
109  virtual bool GetFace(CellFeatureIdentifier, FaceAutoPointer &);
110 
112  virtual bool EvaluatePosition(CoordRepType *,
113  PointsContainer *,
114  CoordRepType *,
115  CoordRepType[],
116  double *,
117  InterpolationWeightType *) ITK_OVERRIDE;
118 
120  itkCellVisitMacro(Superclass::HEXAHEDRON_CELL);
121 
122 protected:
124  PointIdentifier m_PointIds[NumberOfPoints];
125 
126  void InterpolationDerivs(CoordRepType pcoords[3], CoordRepType derivs[24]);
127  void InterpolationFunctions(CoordRepType pcoords[3], InterpolationWeightType sf[8]);
128  void EvaluateLocation(int &itkNotUsed(subId), PointsContainer * points, CoordRepType pcoords[3],
129  CoordRepType x[3], InterpolationWeightType * weights);
130 
131 public:
133  {
134  for ( unsigned int i = 0; i < itkGetStaticConstMacro(NumberOfPoints); i++ )
135  {
137  }
138  }
139 
141 
142 private:
143  HexahedronCell(const Self &); //purposely not implemented
144  void operator=(const Self &); //purposely not implemented
145 };
146 } // end namespace itk
147 
148 #ifndef ITK_MANUAL_INSTANTIATION
149 #include "itkHexahedronCell.hxx"
150 #endif
151 
152 #endif
virtual CellFeatureCount GetNumberOfEdges() const
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override
VertexType::SelfAutoPointer VertexAutoPointer
EdgeType::SelfAutoPointer EdgeAutoPointer
An abstract interface for cells.
FaceType::SelfAutoPointer FaceAutoPointer
virtual CellFeatureCount GetNumberOfFaces() const
void operator=(const Self &)
virtual void SetPointIds(PointIdConstIterator first) override
virtual bool EvaluatePosition(CoordRepType *, PointsContainer *, CoordRepType *, CoordRepType[], double *, InterpolationWeightType *) override
virtual CellGeometry GetType(void) const override
Holds data defining the topological connections of the vertices and edges of a HexahedronCell.
Represents a hexahedron for a Mesh.
static T max(const T &)
virtual unsigned int GetDimension(void) const override
QuadrilateralCell< TCellInterface > FaceType
virtual void SetPointId(int localId, PointIdentifier) override
itkCellCommonTypedefs(HexahedronCell)
void InterpolationDerivs(CoordRepType pcoords[3], CoordRepType derivs[24])
virtual CellFeatureCount GetNumberOfVertices() const
virtual bool GetFace(CellFeatureIdentifier, FaceAutoPointer &)
itkCellVisitMacro(Superclass::HEXAHEDRON_CELL)
itkCellInheritedTypedefs(TCellInterface)
virtual PointIdIterator PointIdsEnd(void) override
PointIdentifier m_PointIds[NumberOfPoints]
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
LineCell< TCellInterface > EdgeType
virtual PointIdIterator PointIdsBegin(void) override
virtual void MakeCopy(CellAutoPointer &) const override
virtual unsigned int GetNumberOfPoints(void) const override
void InterpolationFunctions(CoordRepType pcoords[3], InterpolationWeightType sf[8])
virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &)
Represents a quadrilateral for a Mesh.
virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &)
void EvaluateLocation(int &, PointsContainer *points, CoordRepType pcoords[3], CoordRepType x[3], InterpolationWeightType *weights)
virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override
VertexCell< TCellInterface > VertexType