ITK  5.4.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{
41template <typename TCellInterface>
42class ITK_TEMPLATE_EXPORT QuadrilateralCell
43 : public TCellInterface
45{
46public:
47 ITK_DISALLOW_COPY_AND_MOVE(QuadrilateralCell);
48
51 itkCellInheritedTypedefs(TCellInterface);
55 itkOverrideGetNameOfClassMacro(QuadrilateralCell);
56
59 using VertexAutoPointer = typename VertexType::SelfAutoPointer;
60
63 using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
64
66 static constexpr unsigned int NumberOfPoints = 4;
67 static constexpr unsigned int NumberOfVertices = 4;
68 static constexpr unsigned int NumberOfEdges = 4;
69 static constexpr unsigned int CellDimension = 2;
70 static constexpr unsigned int NumberOfDerivatives = 8;
71
74 GetType() const override
75 {
77 }
78 void
79 MakeCopy(CellAutoPointer &) const override;
82 unsigned int
83 GetDimension() const override;
84
85 unsigned int
86 GetNumberOfPoints() const override;
87
88 CellFeatureCount
89 GetNumberOfBoundaryFeatures(int dimension) const override;
90
91 bool
92 GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
93 void
94 SetPointIds(PointIdConstIterator first) override;
95
96 void
97 SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
98
99 void
100 SetPointId(int localId, PointIdentifier) override;
101 PointIdIterator
102 PointIdsBegin() override;
103
104 PointIdConstIterator
105 PointIdsBegin() const override;
106
107 PointIdIterator
108 PointIdsEnd() override;
109
110 PointIdConstIterator
111 PointIdsEnd() const override;
112
114 virtual CellFeatureCount
116
117 virtual CellFeatureCount
119
120 virtual bool
121 GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
122 virtual bool
123 GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
124
126 bool
127 EvaluatePosition(CoordRepType * x,
128 PointsContainer * points,
129 CoordRepType * closestPoint,
130 CoordRepType[CellDimension],
131 double * dist2,
132 InterpolationWeightType * weight) override;
133
136
138 QuadrilateralCell() = default;
139
140#if defined(__GNUC__)
141 // A bug in some versions of the GCC and Clang compilers
142 // result in an ICE or linker error when "= default" is requested.
143 // This was observed in at least gcc 4.8 and 5.4.0, and
144 // AppleClang 7.0.2 and 8.0.0. Probably others too.
145 // "= default" doesn't gain us much, so just don't use it here.
146 ~QuadrilateralCell() override{};
147#else
148 ~QuadrilateralCell() override = default;
149#endif
150
151protected:
153 std::array<PointIdentifier, NumberOfPoints> m_PointIds{ MakeFilled<std::array<PointIdentifier, NumberOfPoints>>(
155
156 void
157 InterpolationDerivs(const CoordRepType pointCoords[CellDimension], CoordRepType derivs[NumberOfDerivatives]);
158 void
159 InterpolationFunctions(const CoordRepType pointCoords[CellDimension],
160 InterpolationWeightType weights[NumberOfPoints]);
161 void
162 EvaluateLocation(int & itkNotUsed(subId),
163 const PointsContainer * points,
164 const CoordRepType pointCoords[PointDimension],
165 CoordRepType x[PointDimension],
166 InterpolationWeightType * weights);
167};
168} // end namespace itk
169
170#ifndef ITK_MANUAL_INSTANTIATION
171# include "itkQuadrilateralCell.hxx"
172#endif
173
174#endif
Represents a line segment for a Mesh.
Definition: itkLineCell.h:46
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(CoordRepType *x, PointsContainer *points, CoordRepType *closestPoint, CoordRepType[CellDimension], double *dist2, InterpolationWeightType *weight) override
bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override
void SetPointIds(PointIdConstIterator first) override
void InterpolationDerivs(const CoordRepType pointCoords[CellDimension], CoordRepType derivs[NumberOfDerivatives])
void SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override
PointIdIterator PointIdsBegin() override
PointIdIterator PointIdsEnd() override
unsigned int GetDimension() const override
void InterpolationFunctions(const CoordRepType pointCoords[CellDimension], InterpolationWeightType weights[NumberOfPoints])
CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override
PointIdConstIterator PointIdsEnd() const override
virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &)
itkCellVisitMacro(CellGeometryEnum::QUADRILATERAL_CELL)
CellGeometryEnum GetType() const override
virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &)
void EvaluateLocation(int &, const PointsContainer *points, const CoordRepType pointCoords[PointDimension], CoordRepType x[PointDimension], InterpolationWeightType *weights)
itkCellCommonTypedefs(QuadrilateralCell)
virtual CellFeatureCount GetNumberOfVertices() const
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:43
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....