ITK  5.2.0
Insight Toolkit
itkHexahedronCell.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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
45  : public TCellInterface
46  , private HexahedronCellTopology
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_ASSIGN(HexahedronCell);
50 
53  itkCellInheritedTypedefs(TCellInterface);
55 
57  itkTypeMacro(HexahedronCell, CellInterface);
58 
61  using VertexAutoPointer = typename VertexType::SelfAutoPointer;
62 
65  using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
66 
69  using FaceAutoPointer = typename FaceType::SelfAutoPointer;
70 
72  static constexpr unsigned int NumberOfPoints = 8;
73  static constexpr unsigned int NumberOfVertices = 8;
74  static constexpr unsigned int NumberOfEdges = 12;
75  static constexpr unsigned int NumberOfFaces = 6;
76  static constexpr unsigned int CellDimension = 3;
77 
80  GetType() const override
81  {
83  }
84  void
85  MakeCopy(CellAutoPointer &) const override;
87 
88  unsigned int
89  GetDimension() const override;
90 
91  unsigned int
92  GetNumberOfPoints() const override;
93 
94  CellFeatureCount
95  GetNumberOfBoundaryFeatures(int dimension) const override;
96 
97  bool
98  GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
99  void
100  SetPointIds(PointIdConstIterator first) override;
101 
102  void
103  SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
104 
105  void
106  SetPointId(int localId, PointIdentifier) override;
107  PointIdIterator
108  PointIdsBegin() override;
109 
110  PointIdConstIterator
111  PointIdsBegin() const override;
112 
113  PointIdIterator
114  PointIdsEnd() override;
115 
116  PointIdConstIterator
117  PointIdsEnd() const override;
118 
120  virtual CellFeatureCount
121  GetNumberOfVertices() const;
122 
123  virtual CellFeatureCount
124  GetNumberOfEdges() const;
125 
126  virtual CellFeatureCount
127  GetNumberOfFaces() const;
128 
129  virtual bool
130  GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
131  virtual bool
132  GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
133  virtual bool
134  GetFace(CellFeatureIdentifier, FaceAutoPointer &);
135 
137  bool
138  EvaluatePosition(CoordRepType *,
139  PointsContainer *,
140  CoordRepType *,
141  CoordRepType[],
142  double *,
143  InterpolationWeightType *) override;
144 
147 
148 protected:
150  PointIdentifier m_PointIds[NumberOfPoints];
151 
152  void
153  InterpolationDerivs(CoordRepType pcoords[Self::CellDimension],
154  CoordRepType derivs[Self::CellDimension * Self::NumberOfPoints]);
155  void
156  InterpolationFunctions(CoordRepType pcoords[Self::CellDimension], InterpolationWeightType sf[Self::NumberOfPoints]);
157  void
158  EvaluateLocation(int & itkNotUsed(subId),
159  PointsContainer * points,
160  CoordRepType pcoords[Self::CellDimension],
161  CoordRepType x[Self::CellDimension],
162  InterpolationWeightType * weights);
163 
164 public:
166  {
167  for (unsigned int i = 0; i < Self::NumberOfPoints; i++)
168  {
169  m_PointIds[i] = NumericTraits<PointIdentifier>::max();
170  }
171  }
172 
173  ~HexahedronCell() override = default;
174 };
175 } // end namespace itk
176 
177 #ifndef ITK_MANUAL_INSTANTIATION
178 # include "itkHexahedronCell.hxx"
179 #endif
180 
181 #endif
itk::VertexCell
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
itk::QuadrilateralCell
Represents a quadrilateral for a Mesh.
Definition: itkQuadrilateralCell.h:39
itkQuadrilateralCell.h
itk::HexahedronCellTopology
Holds data defining the topological connections of the vertices and edges of a HexahedronCell.
Definition: itkHexahedronCellTopology.h:39
itk::HexahedronCell::EdgeAutoPointer
typename EdgeType::SelfAutoPointer EdgeAutoPointer
Definition: itkHexahedronCell.h:65
itkCellVisitMacro
#define itkCellVisitMacro(TopologyId)
Definition: itkCellInterface.h:32
itk::HexahedronCell::FaceAutoPointer
typename FaceType::SelfAutoPointer FaceAutoPointer
Definition: itkHexahedronCell.h:69
itk::CommonEnums::CellGeometry::HEXAHEDRON_CELL
itk::HexahedronCell
Represents a hexahedron (cuboid) for a Mesh.
Definition: itkHexahedronCell.h:44
itkCellInheritedTypedefs
#define itkCellInheritedTypedefs(superclassArg)
Definition: itkCellInterface.h:55
itk::HexahedronCell::GetType
CellGeometryEnum GetType() const override
Definition: itkHexahedronCell.h:80
itk::CommonEnums::CellGeometry
CellGeometry
Definition: itkCommonEnums.h:138
itk::HexahedronCell::HexahedronCell
HexahedronCell()
Definition: itkHexahedronCell.h:165
itk::LineCell
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
itk::NumericTraits::max
static constexpr T max(const T &)
Definition: itkNumericTraits.h:167
itk::CellInterface
An abstract interface for cells.
Definition: itkCellInterface.h:96
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::HexahedronCell::VertexAutoPointer
typename VertexType::SelfAutoPointer VertexAutoPointer
Definition: itkHexahedronCell.h:61
itkHexahedronCellTopology.h
itkCellCommonTypedefs
#define itkCellCommonTypedefs(celltype)
Definition: itkCellInterface.h:46