ITK  6.0.0
Insight Toolkit
itkTetrahedronCell.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 itkTetrahedronCell_h
19 #define itkTetrahedronCell_h
20 
21 #include "itkTriangleCell.h"
23 #include "itkMakeFilled.h"
24 
25 #include <array>
26 
27 namespace itk
28 {
35 template <typename TCellInterface>
36 class ITK_TEMPLATE_EXPORT TetrahedronCell
37  : public TCellInterface
38  , private TetrahedronCellTopology
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_MOVE(TetrahedronCell);
42 
45  itkCellInheritedTypedefs(TCellInterface);
49  itkOverrideGetNameOfClassMacro(TetrahedronCell);
50 
53  using VertexAutoPointer = typename VertexType::SelfAutoPointer;
54 
57  using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
58 
61  using FaceAutoPointer = typename FaceType::SelfAutoPointer;
62 
64  static constexpr unsigned int NumberOfPoints = 4;
65  static constexpr unsigned int NumberOfVertices = 4;
66  static constexpr unsigned int NumberOfEdges = 6;
67  static constexpr unsigned int NumberOfFaces = 4;
68  static constexpr unsigned int CellDimension = 3;
69 
70  // Standard CellInterface
71 
74  GetType() const override
75  {
77  }
78  void
79  MakeCopy(CellAutoPointer &) const override;
83  unsigned int
84  GetDimension() const override;
85 
87  unsigned int
88  GetNumberOfPoints() const override;
89 
91  CellFeatureCount
92  GetNumberOfBoundaryFeatures(int dimension) const override;
93 
97  bool
98  GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
99 
103  void
104  SetPointIds(PointIdConstIterator first) override;
105 
110  void
111  SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
112 
114  void
115  SetPointId(int localId, PointIdentifier) override;
116 
118  PointIdIterator
119  PointIdsBegin() override;
120 
122  PointIdConstIterator
123  PointIdsBegin() const override;
124 
126  PointIdIterator
127  PointIdsEnd() override;
128 
130  PointIdConstIterator
131  PointIdsEnd() const override;
132 
133  // Tetrahedron-specific interface
134 
136  virtual CellFeatureCount
137  GetNumberOfVertices() const;
138 
140  virtual CellFeatureCount
141  GetNumberOfEdges() const;
142 
144  virtual CellFeatureCount
145  GetNumberOfFaces() const;
146 
150  virtual bool
151  GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
152 
156  virtual bool
157  GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
158 
162  virtual bool
163  GetFace(CellFeatureIdentifier, FaceAutoPointer &);
164 
167 
168  bool
169  EvaluatePosition(CoordRepType *,
170  PointsContainer *,
171  CoordRepType *,
172  CoordRepType[],
173  double *,
174  InterpolationWeightType *) override;
175 
176 public:
177  TetrahedronCell() = default;
178 
179  ~TetrahedronCell() override = default;
180 
181 protected:
183  std::array<PointIdentifier, NumberOfPoints> m_PointIds{ MakeFilled<std::array<PointIdentifier, NumberOfPoints>>(
185 };
186 } // end namespace itk
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 # include "itkTetrahedronCell.hxx"
190 #endif
191 
192 #endif
itk::VertexCell
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:37
itkCellVisitMacro
#define itkCellVisitMacro(TopologyId)
Definition: itkCellInterface.h:32
itk::TetrahedronCell::EdgeAutoPointer
typename EdgeType::SelfAutoPointer EdgeAutoPointer
Definition: itkTetrahedronCell.h:57
itk::TetrahedronCell::VertexAutoPointer
typename VertexType::SelfAutoPointer VertexAutoPointer
Definition: itkTetrahedronCell.h:53
itkTetrahedronCellTopology.h
itk::CommonEnums::CellGeometry
CellGeometry
Definition: itkCommonEnums.h:132
itk::TetrahedronCell
TetrahedronCell represents a tetrahedron for a Mesh.
Definition: itkTetrahedronCell.h:36
itk::TriangleCell
Definition: itkTriangleCell.h:46
itk::TetrahedronCell::FaceAutoPointer
typename FaceType::SelfAutoPointer FaceAutoPointer
Definition: itkTetrahedronCell.h:61
itkCellInheritedTypedefs
#define itkCellInheritedTypedefs(superclassArg)
Definition: itkCellInterface.h:56
itkMakeFilled.h
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::TetrahedronCellTopology
TetrahedronCellTopology holds data defining the topological connections of the vertices and edges of ...
Definition: itkTetrahedronCellTopology.h:36
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::CommonEnums::CellGeometry::TETRAHEDRON_CELL
itkTriangleCell.h
itk::TetrahedronCell::GetType
CellGeometryEnum GetType() const override
Definition: itkTetrahedronCell.h:74
itkCellCommonTypedefs
#define itkCellCommonTypedefs(celltype)
Definition: itkCellInterface.h:47