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 
21 #include "itkQuadrilateralCell.h"
23 #include "itkMakeFilled.h"
24 
25 #include <array>
26 
27 namespace itk
28 {
44 template <typename TCellInterface>
45 class ITK_TEMPLATE_EXPORT HexahedronCell
46  : public TCellInterface
47  , private HexahedronCellTopology
48 {
49 public:
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
130  GetNumberOfVertices() const;
131 
132  virtual CellFeatureCount
133  GetNumberOfEdges() const;
134 
135  virtual CellFeatureCount
136  GetNumberOfFaces() const;
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 
157 protected:
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 
174 public:
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
itk::VertexCell
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:37
itk::QuadrilateralCell
Represents a quadrilateral for a Mesh.
Definition: itkQuadrilateralCell.h:37
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:66
itkCellVisitMacro
#define itkCellVisitMacro(TopologyId)
Definition: itkCellInterface.h:32
itk::HexahedronCell::FaceAutoPointer
typename FaceType::SelfAutoPointer FaceAutoPointer
Definition: itkHexahedronCell.h:70
itk::CommonEnums::CellGeometry::HEXAHEDRON_CELL
itk::HexahedronCell
Represents a hexahedron (cuboid) for a Mesh.
Definition: itkHexahedronCell.h:45
itkCellInheritedTypedefs
#define itkCellInheritedTypedefs(superclassArg)
Definition: itkCellInterface.h:56
itkMakeFilled.h
itk::HexahedronCell::GetType
CellGeometryEnum GetType() const override
Definition: itkHexahedronCell.h:89
itk::CommonEnums::CellGeometry
CellGeometry
Definition: itkCommonEnums.h:138
itk::LineCell
Represents a line segment for a Mesh.
Definition: itkLineCell.h:40
itk::NumericTraits::max
static constexpr T max(const T &)
Definition: itkNumericTraits.h:169
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:62
itkHexahedronCellTopology.h
itkCellCommonTypedefs
#define itkCellCommonTypedefs(celltype)
Definition: itkCellInterface.h:47