ITK  5.2.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  * http://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 
24 namespace itk
25 {
36 template <typename TCellInterface>
37 class ITK_TEMPLATE_EXPORT TetrahedronCell
38  : public TCellInterface
39  , private TetrahedronCellTopology
40 {
41 public:
42  ITK_DISALLOW_COPY_AND_ASSIGN(TetrahedronCell);
43 
46  itkCellInheritedTypedefs(TCellInterface);
48 
50  itkTypeMacro(TetrahedronCell, CellInterface);
51 
54  using VertexAutoPointer = typename VertexType::SelfAutoPointer;
55 
58  using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
59 
62  using FaceAutoPointer = typename FaceType::SelfAutoPointer;
63 
65  static constexpr unsigned int NumberOfPoints = 4;
66  static constexpr unsigned int NumberOfVertices = 4;
67  static constexpr unsigned int NumberOfEdges = 6;
68  static constexpr unsigned int NumberOfFaces = 4;
69  static constexpr unsigned int CellDimension = 3;
70 
73  GetType() const override
74  {
76  }
77  void
78  MakeCopy(CellAutoPointer &) const override;
80 
81  unsigned int
82  GetDimension() const override;
83 
84  unsigned int
85  GetNumberOfPoints() const override;
86 
87  CellFeatureCount
88  GetNumberOfBoundaryFeatures(int dimension) const override;
89 
90  bool
91  GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
92  void
93  SetPointIds(PointIdConstIterator first) override;
94 
95  void
96  SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
97 
98  void
99  SetPointId(int localId, PointIdentifier) override;
100  PointIdIterator
101  PointIdsBegin() override;
102 
103  PointIdConstIterator
104  PointIdsBegin() const override;
105 
106  PointIdIterator
107  PointIdsEnd() override;
108 
109  PointIdConstIterator
110  PointIdsEnd() const override;
111 
113  virtual CellFeatureCount
114  GetNumberOfVertices() const;
115 
116  virtual CellFeatureCount
117  GetNumberOfEdges() const;
118 
119  virtual CellFeatureCount
120  GetNumberOfFaces() const;
121 
122  virtual bool
123  GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
124  virtual bool
125  GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
126  virtual bool
127  GetFace(CellFeatureIdentifier, FaceAutoPointer &);
128 
131 
132  bool
133  EvaluatePosition(CoordRepType *,
134  PointsContainer *,
135  CoordRepType *,
136  CoordRepType[],
137  double *,
138  InterpolationWeightType *) override;
139 
140 public:
142  {
143  for (PointIdentifier i = 0; i < Self::NumberOfPoints; i++)
144  {
145  m_PointIds[i] = NumericTraits<PointIdentifier>::max();
146  }
147  }
148 
149  ~TetrahedronCell() override = default;
150 
151 protected:
153  PointIdentifier m_PointIds[NumberOfPoints];
154 };
155 } // end namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 # include "itkTetrahedronCell.hxx"
159 #endif
160 
161 #endif
itk::VertexCell
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
itkCellVisitMacro
#define itkCellVisitMacro(TopologyId)
Definition: itkCellInterface.h:32
itk::TetrahedronCell::EdgeAutoPointer
typename EdgeType::SelfAutoPointer EdgeAutoPointer
Definition: itkTetrahedronCell.h:58
itk::TetrahedronCell::VertexAutoPointer
typename VertexType::SelfAutoPointer VertexAutoPointer
Definition: itkTetrahedronCell.h:54
itkTetrahedronCellTopology.h
itk::TetrahedronCell
TetrahedronCell represents a tetrahedron for a Mesh.
Definition: itkTetrahedronCell.h:37
itk::TriangleCell
Definition: itkTriangleCell.h:45
itk::TetrahedronCell::FaceAutoPointer
typename FaceType::SelfAutoPointer FaceAutoPointer
Definition: itkTetrahedronCell.h:62
itkCellInheritedTypedefs
#define itkCellInheritedTypedefs(superclassArg)
Definition: itkCellInterface.h:55
itk::CommonEnums::CellGeometry
CellGeometry
Definition: itkCommonEnums.h:138
itk::LineCell
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
itk::NumericTraits::max
static constexpr T max(const T &)
Definition: itkNumericTraits.h:167
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:73
itkCellCommonTypedefs
#define itkCellCommonTypedefs(celltype)
Definition: itkCellInterface.h:46
itk::TetrahedronCell::TetrahedronCell
TetrahedronCell()
Definition: itkTetrahedronCell.h:141