ITK  4.9.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  itkStaticConstMacro(NumberOfPoints, unsigned int, 8);
69  itkStaticConstMacro(NumberOfVertices, unsigned int, 8);
70  itkStaticConstMacro(NumberOfEdges, unsigned int, 12);
71  itkStaticConstMacro(NumberOfFaces, unsigned int, 6);
72  itkStaticConstMacro(CellDimension, unsigned int, 3);
74 
76  virtual CellGeometry GetType(void) const ITK_OVERRIDE
77  { return Superclass::HEXAHEDRON_CELL; }
78  virtual void MakeCopy(CellAutoPointer &) const ITK_OVERRIDE;
80 
81  virtual unsigned int GetDimension(void) const ITK_OVERRIDE;
82 
83  virtual unsigned int GetNumberOfPoints(void) const ITK_OVERRIDE;
84 
85  virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const ITK_OVERRIDE;
86 
87  virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) ITK_OVERRIDE;
88  virtual void SetPointIds(PointIdConstIterator first) ITK_OVERRIDE;
89 
90  virtual void SetPointIds(PointIdConstIterator first, PointIdConstIterator last) ITK_OVERRIDE;
91 
92  virtual void SetPointId(int localId, PointIdentifier) ITK_OVERRIDE;
93  virtual PointIdIterator PointIdsBegin(void) ITK_OVERRIDE;
94 
95  virtual PointIdConstIterator PointIdsBegin(void) const ITK_OVERRIDE;
96 
97  virtual PointIdIterator PointIdsEnd(void) ITK_OVERRIDE;
98 
99  virtual PointIdConstIterator PointIdsEnd(void) const ITK_OVERRIDE;
100 
102  virtual CellFeatureCount GetNumberOfVertices() const;
103 
104  virtual CellFeatureCount GetNumberOfEdges() const;
105 
106  virtual CellFeatureCount GetNumberOfFaces() const;
107 
108  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
109  virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
110  virtual bool GetFace(CellFeatureIdentifier, FaceAutoPointer &);
111 
113  virtual bool EvaluatePosition(CoordRepType *,
114  PointsContainer *,
115  CoordRepType *,
116  CoordRepType[],
117  double *,
118  InterpolationWeightType *) ITK_OVERRIDE;
119 
121  itkCellVisitMacro(Superclass::HEXAHEDRON_CELL);
122 
123 protected:
125  PointIdentifier m_PointIds[NumberOfPoints];
126 
127  void InterpolationDerivs(CoordRepType pcoords[3], CoordRepType derivs[24]);
128  void InterpolationFunctions(CoordRepType pcoords[3], InterpolationWeightType sf[8]);
129  void EvaluateLocation(int &itkNotUsed(subId), PointsContainer * points, CoordRepType pcoords[3],
130  CoordRepType x[3], InterpolationWeightType * weights);
131 
132 public:
134  {
135  for ( unsigned int i = 0; i < itkGetStaticConstMacro(NumberOfPoints); i++ )
136  {
138  }
139  }
140 
142 
143 private:
144  HexahedronCell(const Self &) ITK_DELETE_FUNCTION;
145  void operator=(const Self &) ITK_DELETE_FUNCTION;
146 };
147 } // end namespace itk
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
150 #include "itkHexahedronCell.hxx"
151 #endif
152 
153 #endif
virtual CellFeatureCount GetNumberOfEdges() const
static const unsigned int NumberOfVertices
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
static const unsigned int NumberOfPoints
virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override
static const unsigned int CellDimension
VertexType::SelfAutoPointer VertexAutoPointer
EdgeType::SelfAutoPointer EdgeAutoPointer
An abstract interface for cells.
FaceType::SelfAutoPointer FaceAutoPointer
virtual CellFeatureCount GetNumberOfFaces() const
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)
static const unsigned int NumberOfFaces
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)
static const unsigned int NumberOfEdges
virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override
VertexCell< TCellInterface > VertexType