ITK  6.0.0
Insight Toolkit
itkQuadrilateralCell.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 itkQuadrilateralCell_h
19#define itkQuadrilateralCell_h
20
21#include "itkLineCell.h"
23#include "itkMakeFilled.h"
24
25#include <array>
26
27namespace itk
28{
36template <typename TCellInterface>
37class ITK_TEMPLATE_EXPORT QuadrilateralCell
38 : public TCellInterface
40{
41public:
42 ITK_DISALLOW_COPY_AND_MOVE(QuadrilateralCell);
43
46 itkCellInheritedTypedefs(TCellInterface);
50 itkOverrideGetNameOfClassMacro(QuadrilateralCell);
51
54 using VertexAutoPointer = typename VertexType::SelfAutoPointer;
55
58 using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
59
61 static constexpr unsigned int NumberOfPoints = 4;
62 static constexpr unsigned int NumberOfVertices = 4;
63 static constexpr unsigned int NumberOfEdges = 4;
64 static constexpr unsigned int CellDimension = 2;
65 static constexpr unsigned int NumberOfDerivatives = 8;
66
69 GetType() const override
70 {
72 }
73 void
74 MakeCopy(CellAutoPointer &) const override;
77 unsigned int
78 GetDimension() const override;
79
80 unsigned int
81 GetNumberOfPoints() const override;
82
83 CellFeatureCount
84 GetNumberOfBoundaryFeatures(int dimension) const override;
85
86 bool
87 GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
88 void
89 SetPointIds(PointIdConstIterator first) override;
90
91 void
92 SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
93
94 void
95 SetPointId(int localId, PointIdentifier) override;
96 PointIdIterator
97 PointIdsBegin() override;
98
99 PointIdConstIterator
100 PointIdsBegin() const override;
101
102 PointIdIterator
103 PointIdsEnd() override;
104
105 PointIdConstIterator
106 PointIdsEnd() const override;
107
109 virtual CellFeatureCount
111
112 virtual CellFeatureCount
114
115 virtual bool
116 GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
117 virtual bool
118 GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
119
121 bool
122 EvaluatePosition(CoordinateType * x,
123 PointsContainer * points,
124 CoordinateType * closestPoint,
125 CoordinateType[CellDimension],
126 double * dist2,
127 InterpolationWeightType * weight) override;
128
131
133 QuadrilateralCell() = default;
134 ~QuadrilateralCell() override = default;
137protected:
139 std::array<PointIdentifier, NumberOfPoints> m_PointIds{ MakeFilled<std::array<PointIdentifier, NumberOfPoints>>(
141
142 void
143 InterpolationDerivs(const CoordinateType pointCoords[CellDimension], CoordinateType derivs[NumberOfDerivatives]);
144 void
145 InterpolationFunctions(const CoordinateType pointCoords[CellDimension],
146 InterpolationWeightType weights[NumberOfPoints]);
147 void
148 EvaluateLocation(int & itkNotUsed(subId),
149 const PointsContainer * points,
150 const CoordinateType pointCoords[PointDimension],
151 CoordinateType x[PointDimension],
152 InterpolationWeightType * weights);
153};
154} // end namespace itk
155
156#ifndef ITK_MANUAL_INSTANTIATION
157# include "itkQuadrilateralCell.hxx"
158#endif
159
160#endif
Represents a line segment for a Mesh.
Definition: itkLineCell.h:41
static constexpr T max(const T &)
Holds data defining the topological connections of the vertices and edges of a QuadrilateralCell.
Represents a quadrilateral for a Mesh.
void MakeCopy(CellAutoPointer &) const override
itkCellInheritedTypedefs(TCellInterface)
~QuadrilateralCell() override=default
virtual CellFeatureCount GetNumberOfEdges() const
typename EdgeType::SelfAutoPointer EdgeAutoPointer
unsigned int GetNumberOfPoints() const override
void SetPointId(int localId, PointIdentifier) override
PointIdConstIterator PointIdsBegin() const override
typename VertexType::SelfAutoPointer VertexAutoPointer
bool EvaluatePosition(CoordinateType *x, PointsContainer *points, CoordinateType *closestPoint, CoordinateType[CellDimension], double *dist2, InterpolationWeightType *weight) override
void EvaluateLocation(int &, const PointsContainer *points, const CoordinateType pointCoords[PointDimension], CoordinateType x[PointDimension], InterpolationWeightType *weights)
bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override
void SetPointIds(PointIdConstIterator first) override
void SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override
PointIdIterator PointIdsBegin() override
PointIdIterator PointIdsEnd() override
unsigned int GetDimension() const override
CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override
void InterpolationDerivs(const CoordinateType pointCoords[CellDimension], CoordinateType derivs[NumberOfDerivatives])
PointIdConstIterator PointIdsEnd() const override
virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &)
itkCellVisitMacro(CellGeometryEnum::QUADRILATERAL_CELL)
CellGeometryEnum GetType() const override
virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &)
itkCellCommonTypedefs(QuadrilateralCell)
virtual CellFeatureCount GetNumberOfVertices() const
void InterpolationFunctions(const CoordinateType pointCoords[CellDimension], InterpolationWeightType weights[NumberOfPoints])
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:38
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....