ITK  4.13.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 ITK_TEMPLATE_EXPORT 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  {
137  m_PointIds[i] = NumericTraits< PointIdentifier >::max();
138  }
139  }
140 
141  ~HexahedronCell() ITK_OVERRIDE {}
142 
143 private:
144  ITK_DISALLOW_COPY_AND_ASSIGN(HexahedronCell);
145 };
146 } // end namespace itk
147 
148 #ifndef ITK_MANUAL_INSTANTIATION
149 #include "itkHexahedronCell.hxx"
150 #endif
151 
152 #endif
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
VertexType::SelfAutoPointer VertexAutoPointer
EdgeType::SelfAutoPointer EdgeAutoPointer
An abstract interface for cells.
FaceType::SelfAutoPointer FaceAutoPointer
static ITK_CONSTEXPR_FUNC T max(const T &)
virtual CellGeometry GetType(void) const override
#define itkCellCommonTypedefs(celltype)
Holds data defining the topological connections of the vertices and edges of a HexahedronCell.
Represents a hexahedron for a Mesh.
QuadrilateralCell< TCellInterface > FaceType
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
LineCell< TCellInterface > EdgeType
#define itkCellVisitMacro(TopologyId)
Represents a quadrilateral for a Mesh.
#define itkCellInheritedTypedefs(superclassArg)
VertexCell< TCellInterface > VertexType