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  itkOverrideGetNameOfClassMacro(TetrahedronCell);
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 
74  // Standard CellInterface
75 
78  GetType() const override
79  {
81  }
82  void
83  MakeCopy(CellAutoPointer &) const override;
87  unsigned int
88  GetDimension() const override;
89 
91  unsigned int
92  GetNumberOfPoints() const override;
93 
95  CellFeatureCount
96  GetNumberOfBoundaryFeatures(int dimension) const override;
97 
101  bool
102  GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
103 
107  void
108  SetPointIds(PointIdConstIterator first) override;
109 
114  void
115  SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
116 
118  void
119  SetPointId(int localId, PointIdentifier) override;
120 
122  PointIdIterator
123  PointIdsBegin() override;
124 
126  PointIdConstIterator
127  PointIdsBegin() const override;
128 
130  PointIdIterator
131  PointIdsEnd() override;
132 
134  PointIdConstIterator
135  PointIdsEnd() const override;
136 
137  // Tetrahedron-specific interface
138 
140  virtual CellFeatureCount
141  GetNumberOfVertices() const;
142 
144  virtual CellFeatureCount
145  GetNumberOfEdges() const;
146 
148  virtual CellFeatureCount
149  GetNumberOfFaces() const;
150 
154  virtual bool
155  GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
156 
160  virtual bool
161  GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
162 
166  virtual bool
167  GetFace(CellFeatureIdentifier, FaceAutoPointer &);
168 
171 
172  bool
173  EvaluatePosition(CoordRepType *,
174  PointsContainer *,
175  CoordRepType *,
176  CoordRepType[],
177  double *,
178  InterpolationWeightType *) override;
179 
180 public:
181  TetrahedronCell() = default;
182 
183  ~TetrahedronCell() override = default;
184 
185 protected:
187  std::array<PointIdentifier, NumberOfPoints> m_PointIds{ MakeFilled<std::array<PointIdentifier, NumberOfPoints>>(
189 };
190 } // end namespace itk
191 
192 #ifndef ITK_MANUAL_INSTANTIATION
193 # include "itkTetrahedronCell.hxx"
194 #endif
195 
196 #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::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:78
itkCellCommonTypedefs
#define itkCellCommonTypedefs(celltype)
Definition: itkCellInterface.h:46