ITK  5.4.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 {
39 template <typename TCellInterface>
40 class ITK_TEMPLATE_EXPORT TetrahedronCell
41  : public TCellInterface
42  , private TetrahedronCellTopology
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_MOVE(TetrahedronCell);
46 
49  itkCellInheritedTypedefs(TCellInterface);
53  itkTypeMacro(TetrahedronCell, CellInterface);
54 
57  using VertexAutoPointer = typename VertexType::SelfAutoPointer;
58 
61  using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
62 
65  using FaceAutoPointer = typename FaceType::SelfAutoPointer;
66 
68  static constexpr unsigned int NumberOfPoints = 4;
69  static constexpr unsigned int NumberOfVertices = 4;
70  static constexpr unsigned int NumberOfEdges = 6;
71  static constexpr unsigned int NumberOfFaces = 4;
72  static constexpr unsigned int CellDimension = 3;
73 
76  GetType() const override
77  {
79  }
80  void
81  MakeCopy(CellAutoPointer &) const override;
84  unsigned int
85  GetDimension() const override;
86 
87  unsigned int
88  GetNumberOfPoints() const override;
89 
90  CellFeatureCount
91  GetNumberOfBoundaryFeatures(int dimension) const override;
92 
93  bool
94  GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
95  void
96  SetPointIds(PointIdConstIterator first) override;
97 
98  void
99  SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
100 
101  void
102  SetPointId(int localId, PointIdentifier) override;
103  PointIdIterator
104  PointIdsBegin() override;
105 
106  PointIdConstIterator
107  PointIdsBegin() const override;
108 
109  PointIdIterator
110  PointIdsEnd() override;
111 
112  PointIdConstIterator
113  PointIdsEnd() const override;
114 
116  virtual CellFeatureCount
117  GetNumberOfVertices() const;
118 
119  virtual CellFeatureCount
120  GetNumberOfEdges() const;
121 
122  virtual CellFeatureCount
123  GetNumberOfFaces() const;
124 
125  virtual bool
126  GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
127  virtual bool
128  GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
129  virtual bool
130  GetFace(CellFeatureIdentifier, FaceAutoPointer &);
131 
134 
135  bool
136  EvaluatePosition(CoordRepType *,
137  PointsContainer *,
138  CoordRepType *,
139  CoordRepType[],
140  double *,
141  InterpolationWeightType *) override;
142 
143 public:
144  TetrahedronCell() = default;
145 
146  ~TetrahedronCell() override = default;
147 
148 protected:
150  std::array<PointIdentifier, NumberOfPoints> m_PointIds{ MakeFilled<std::array<PointIdentifier, NumberOfPoints>>(
152 };
153 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 # include "itkTetrahedronCell.hxx"
157 #endif
158 
159 #endif
itk::VertexCell
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:42
itkCellVisitMacro
#define itkCellVisitMacro(TopologyId)
Definition: itkCellInterface.h:32
itk::TetrahedronCell::EdgeAutoPointer
typename EdgeType::SelfAutoPointer EdgeAutoPointer
Definition: itkTetrahedronCell.h:61
itk::TetrahedronCell::VertexAutoPointer
typename VertexType::SelfAutoPointer VertexAutoPointer
Definition: itkTetrahedronCell.h:57
itkTetrahedronCellTopology.h
itk::TetrahedronCell
TetrahedronCell represents a tetrahedron for a Mesh.
Definition: itkTetrahedronCell.h:40
itk::TriangleCell
Definition: itkTriangleCell.h:46
itk::TetrahedronCell::FaceAutoPointer
typename FaceType::SelfAutoPointer FaceAutoPointer
Definition: itkTetrahedronCell.h:65
itkCellInheritedTypedefs
#define itkCellInheritedTypedefs(superclassArg)
Definition: itkCellInterface.h:55
itkMakeFilled.h
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::TetrahedronCellTopology
TetrahedronCellTopology holds data defining the topological connections of the vertices and edges of ...
Definition: itkTetrahedronCellTopology.h:36
itk::CellInterface
An abstract interface for cells.
Definition: itkCellInterface.h:96
itk::CommonEnums::CellGeometry::TETRAHEDRON_CELL
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkTriangleCell.h
itk::TetrahedronCell::GetType
CellGeometryEnum GetType() const override
Definition: itkTetrahedronCell.h:76
itkCellCommonTypedefs
#define itkCellCommonTypedefs(celltype)
Definition: itkCellInterface.h:46