ITK  6.0.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{
44template <typename TCellInterface>
45class ITK_TEMPLATE_EXPORT HexahedronCell
46 : public TCellInterface
48{
49public:
50 ITK_DISALLOW_COPY_AND_MOVE(HexahedronCell);
51
54 itkCellInheritedTypedefs(TCellInterface);
58 itkOverrideGetNameOfClassMacro(HexahedronCell);
59
62 using VertexAutoPointer = typename VertexType::SelfAutoPointer;
63
66 using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
67
70 using FaceAutoPointer = typename FaceType::SelfAutoPointer;
71
73 static constexpr unsigned int NumberOfPoints = 8;
74 static constexpr unsigned int NumberOfVertices = 8;
75 static constexpr unsigned int NumberOfEdges = 12;
76 static constexpr unsigned int NumberOfFaces = 6;
77 static constexpr unsigned int CellDimension = 3;
78
84 static constexpr unsigned int CellDimension3D = 3;
85 static constexpr unsigned int PointDimension3D = 3;
86
89 GetType() const override
90 {
92 }
93 void
94 MakeCopy(CellAutoPointer &) const override;
97 unsigned int
98 GetDimension() const override;
99
100 unsigned int
101 GetNumberOfPoints() const override;
102
103 CellFeatureCount
104 GetNumberOfBoundaryFeatures(int dimension) const override;
105
106 bool
107 GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
108 void
109 SetPointIds(PointIdConstIterator first) override;
110
111 void
112 SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
113
114 void
115 SetPointId(int localId, PointIdentifier) override;
116 PointIdIterator
117 PointIdsBegin() override;
118
119 PointIdConstIterator
120 PointIdsBegin() const override;
121
122 PointIdIterator
123 PointIdsEnd() override;
124
125 PointIdConstIterator
126 PointIdsEnd() const override;
127
129 virtual CellFeatureCount
131
132 virtual CellFeatureCount
134
135 virtual CellFeatureCount
137
138 virtual bool
139 GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
140 virtual bool
141 GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
142 virtual bool
143 GetFace(CellFeatureIdentifier, FaceAutoPointer &);
144
146 bool
147 EvaluatePosition(CoordRepType *,
148 PointsContainer *,
149 CoordRepType *,
150 CoordRepType[],
151 double *,
152 InterpolationWeightType *) override;
153
156
157protected:
159 std::array<PointIdentifier, NumberOfPoints> m_PointIds{ MakeFilled<std::array<PointIdentifier, NumberOfPoints>>(
161
162 void
163 InterpolationDerivs(CoordRepType pcoords[Self::CellDimension],
164 CoordRepType derivs[Self::CellDimension * Self::NumberOfPoints]);
165 void
166 InterpolationFunctions(CoordRepType pcoords[Self::CellDimension], InterpolationWeightType sf[Self::NumberOfPoints]);
167 void
168 EvaluateLocation(int & itkNotUsed(subId),
169 PointsContainer * points,
170 CoordRepType pcoords[Self::CellDimension],
171 CoordRepType x[Self::CellDimension],
172 InterpolationWeightType * weights);
173
174public:
175 HexahedronCell() = default;
176
177 ~HexahedronCell() override = default;
178};
179} // end namespace itk
180
181#ifndef ITK_MANUAL_INSTANTIATION
182# include "itkHexahedronCell.hxx"
183#endif
184
185#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:41
static constexpr T max(const T &)
Represents a quadrilateral for a Mesh.
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:38
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....