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 
21 #include "itkQuadrilateralCell.h"
23 #include "itkMakeFilled.h"
24 
25 #include <array>
26 
27 namespace itk
28 {
49 template <typename TCellInterface>
50 class ITK_TEMPLATE_EXPORT HexahedronCell
51  : public TCellInterface
52  , private HexahedronCellTopology
53 {
54 public:
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
135  GetNumberOfVertices() const;
136 
137  virtual CellFeatureCount
138  GetNumberOfEdges() const;
139 
140  virtual CellFeatureCount
141  GetNumberOfFaces() const;
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 
162 protected:
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 
179 public:
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
itk::VertexCell
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:42
itk::QuadrilateralCell
Represents a quadrilateral for a Mesh.
Definition: itkQuadrilateralCell.h:42
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:71
itkCellVisitMacro
#define itkCellVisitMacro(TopologyId)
Definition: itkCellInterface.h:32
itk::HexahedronCell::FaceAutoPointer
typename FaceType::SelfAutoPointer FaceAutoPointer
Definition: itkHexahedronCell.h:75
itk::CommonEnums::CellGeometry::HEXAHEDRON_CELL
itk::HexahedronCell
Represents a hexahedron (cuboid) for a Mesh.
Definition: itkHexahedronCell.h:50
itkCellInheritedTypedefs
#define itkCellInheritedTypedefs(superclassArg)
Definition: itkCellInterface.h:55
itkMakeFilled.h
itk::HexahedronCell::GetType
CellGeometryEnum GetType() const override
Definition: itkHexahedronCell.h:94
itk::CommonEnums::CellGeometry
CellGeometry
Definition: itkCommonEnums.h:138
itk::LineCell
Represents a line segment for a Mesh.
Definition: itkLineCell.h:45
itk::NumericTraits::max
static constexpr T max(const T &)
Definition: itkNumericTraits.h:168
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:67
itkHexahedronCellTopology.h
itkCellCommonTypedefs
#define itkCellCommonTypedefs(celltype)
Definition: itkCellInterface.h:46