ITK  5.4.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 * https://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
23#include "itkMakeFilled.h"
24
25#include <array>
26
27namespace itk
28{
49template <typename TCellInterface>
50class ITK_TEMPLATE_EXPORT HexahedronCell
51 : public TCellInterface
53{
54public:
55 ITK_DISALLOW_COPY_AND_MOVE(HexahedronCell);
56
59 itkCellInheritedTypedefs(TCellInterface);
63 itkOverrideGetNameOfClassMacro(HexahedronCell);
64
67 using VertexAutoPointer = typename VertexType::SelfAutoPointer;
68
71 using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
72
75 using FaceAutoPointer = typename FaceType::SelfAutoPointer;
76
78 static constexpr unsigned int NumberOfPoints = 8;
79 static constexpr unsigned int NumberOfVertices = 8;
80 static constexpr unsigned int NumberOfEdges = 12;
81 static constexpr unsigned int NumberOfFaces = 6;
82 static constexpr unsigned int CellDimension = 3;
83
89 static constexpr unsigned int CellDimension3D = 3;
90 static constexpr unsigned int PointDimension3D = 3;
91
94 GetType() const override
95 {
97 }
98 void
99 MakeCopy(CellAutoPointer &) const override;
102 unsigned int
103 GetDimension() const override;
104
105 unsigned int
106 GetNumberOfPoints() const override;
107
108 CellFeatureCount
109 GetNumberOfBoundaryFeatures(int dimension) const override;
110
111 bool
112 GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
113 void
114 SetPointIds(PointIdConstIterator first) override;
115
116 void
117 SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
118
119 void
120 SetPointId(int localId, PointIdentifier) override;
121 PointIdIterator
122 PointIdsBegin() override;
123
124 PointIdConstIterator
125 PointIdsBegin() const override;
126
127 PointIdIterator
128 PointIdsEnd() override;
129
130 PointIdConstIterator
131 PointIdsEnd() const override;
132
134 virtual CellFeatureCount
136
137 virtual CellFeatureCount
139
140 virtual CellFeatureCount
142
143 virtual bool
144 GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
145 virtual bool
146 GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
147 virtual bool
148 GetFace(CellFeatureIdentifier, FaceAutoPointer &);
149
151 bool
152 EvaluatePosition(CoordRepType *,
153 PointsContainer *,
154 CoordRepType *,
155 CoordRepType[],
156 double *,
157 InterpolationWeightType *) override;
158
161
162protected:
164 std::array<PointIdentifier, NumberOfPoints> m_PointIds{ MakeFilled<std::array<PointIdentifier, NumberOfPoints>>(
166
167 void
168 InterpolationDerivs(CoordRepType pcoords[Self::CellDimension],
169 CoordRepType derivs[Self::CellDimension * Self::NumberOfPoints]);
170 void
171 InterpolationFunctions(CoordRepType pcoords[Self::CellDimension], InterpolationWeightType sf[Self::NumberOfPoints]);
172 void
173 EvaluateLocation(int & itkNotUsed(subId),
174 PointsContainer * points,
175 CoordRepType pcoords[Self::CellDimension],
176 CoordRepType x[Self::CellDimension],
177 InterpolationWeightType * weights);
178
179public:
180 HexahedronCell() = default;
181
182 ~HexahedronCell() override = default;
183};
184} // end namespace itk
185
186#ifndef ITK_MANUAL_INSTANTIATION
187# include "itkHexahedronCell.hxx"
188#endif
189
190#endif
Holds data defining the topological connections of the vertices and edges of a HexahedronCell.
Represents a hexahedron (cuboid) for a Mesh.
unsigned int GetNumberOfPoints() const override
void InterpolationDerivs(CoordRepType pcoords[Self::CellDimension], CoordRepType derivs[Self::CellDimension *Self::NumberOfPoints])
virtual bool GetFace(CellFeatureIdentifier, FaceAutoPointer &)
itkCellInheritedTypedefs(TCellInterface)
CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override
bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override
virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &)
virtual CellFeatureCount GetNumberOfEdges() const
PointIdConstIterator PointIdsEnd() const override
virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &)
void InterpolationFunctions(CoordRepType pcoords[Self::CellDimension], InterpolationWeightType sf[Self::NumberOfPoints])
void MakeCopy(CellAutoPointer &) const override
~HexahedronCell() override=default
HexahedronCell()=default
bool EvaluatePosition(CoordRepType *, PointsContainer *, CoordRepType *, CoordRepType[], double *, InterpolationWeightType *) override
typename EdgeType::SelfAutoPointer EdgeAutoPointer
typename VertexType::SelfAutoPointer VertexAutoPointer
void SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override
CellGeometryEnum GetType() const override
void EvaluateLocation(int &, PointsContainer *points, CoordRepType pcoords[Self::CellDimension], CoordRepType x[Self::CellDimension], InterpolationWeightType *weights)
PointIdConstIterator PointIdsBegin() const override
virtual CellFeatureCount GetNumberOfVertices() const
typename FaceType::SelfAutoPointer FaceAutoPointer
PointIdIterator PointIdsBegin() override
itkCellVisitMacro(CellGeometryEnum::HEXAHEDRON_CELL)
void SetPointIds(PointIdConstIterator first) override
virtual CellFeatureCount GetNumberOfFaces() const
PointIdIterator PointIdsEnd() override
void SetPointId(int localId, PointIdentifier) override
itkCellCommonTypedefs(HexahedronCell)
unsigned int GetDimension() const override
Represents a line segment for a Mesh.
Definition: itkLineCell.h:46
static constexpr T max(const T &)
Represents a quadrilateral for a Mesh.
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:43
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....