ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkTetrahedronCell.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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:public TCellInterface, private TetrahedronCellTopology
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_ASSIGN(TetrahedronCell);
41 
44  itkCellInheritedTypedefs(TCellInterface);
46 
48  itkTypeMacro(TetrahedronCell, CellInterface);
49 
52  using VertexAutoPointer = typename VertexType::SelfAutoPointer;
53 
56  using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
57 
60  using FaceAutoPointer = typename FaceType::SelfAutoPointer;
61 
63  static constexpr unsigned int NumberOfPoints = 4;
64  static constexpr unsigned int NumberOfVertices = 4;
65  static constexpr unsigned int NumberOfEdges = 6;
66  static constexpr unsigned int NumberOfFaces = 4;
67  static constexpr unsigned int CellDimension = 3;
68 
70  CellGeometry GetType() const override
71  { return Superclass::TETRAHEDRON_CELL; }
72  void MakeCopy(CellAutoPointer &) const override;
74 
75  unsigned int GetDimension() const override;
76 
77  unsigned int GetNumberOfPoints() const override;
78 
79  CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override;
80 
81  bool GetBoundaryFeature(int dimension, CellFeatureIdentifier,
82  CellAutoPointer &) override;
83  void SetPointIds(PointIdConstIterator first) override;
84 
85  void SetPointIds(PointIdConstIterator first,
86  PointIdConstIterator last) override;
87 
88  void SetPointId(int localId, PointIdentifier) override;
89  PointIdIterator PointIdsBegin() override;
90 
91  PointIdConstIterator PointIdsBegin() const override;
92 
93  PointIdIterator PointIdsEnd() override;
94 
95  PointIdConstIterator PointIdsEnd() const override;
96 
98  virtual CellFeatureCount GetNumberOfVertices() const;
99 
100  virtual CellFeatureCount GetNumberOfEdges() const;
101 
102  virtual CellFeatureCount GetNumberOfFaces() const;
103 
104  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
105  virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
106  virtual bool GetFace(CellFeatureIdentifier, FaceAutoPointer &);
107 
109  itkCellVisitMacro(Superclass::TETRAHEDRON_CELL);
110 
111  bool EvaluatePosition(CoordRepType *,
112  PointsContainer *,
113  CoordRepType *,
114  CoordRepType[],
115  double *,
116  InterpolationWeightType *) override;
117 
118 public:
120  {
121  for ( PointIdentifier i = 0; i < Self::NumberOfPoints; i++ )
122  {
123  m_PointIds[i] = NumericTraits< PointIdentifier >::max();
124  }
125  }
126 
127  ~TetrahedronCell() override = default;
128 
129 protected:
131  PointIdentifier m_PointIds[NumberOfPoints];
132 };
133 } // end namespace itk
134 
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "itkTetrahedronCell.hxx"
137 #endif
138 
139 #endif
TetrahedronCellTopology holds data defining the topological connections of the vertices and edges of ...
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
Define numeric traits for std::vector.
typename FaceType::SelfAutoPointer FaceAutoPointer
An abstract interface for cells.
CellGeometry GetType() const override
#define itkCellCommonTypedefs(celltype)
TetrahedronCell represents a tetrahedron for a Mesh.
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
#define itkCellVisitMacro(TopologyId)
typename VertexType::SelfAutoPointer VertexAutoPointer
typename EdgeType::SelfAutoPointer EdgeAutoPointer
#define itkCellInheritedTypedefs(superclassArg)