ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkVertexCell.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 itkVertexCell_h
19 #define itkVertexCell_h
20 
21 #include "itkCellInterface.h"
22 #include "itkNumericTraits.h"
23 
24 namespace itk
25 {
38 template< typename TCellInterface >
39 class ITK_TEMPLATE_EXPORT VertexCell:public TCellInterface
40 {
41 public:
42  ITK_DISALLOW_COPY_AND_ASSIGN(VertexCell);
43 
46  itkCellInheritedTypedefs(TCellInterface);
48 
50  itkTypeMacro(VertexCell, CellInterface);
51 
53  static constexpr unsigned int NumberOfPoints = 1;
54  static constexpr unsigned int CellDimension = 0;
55 
57  CellGeometry GetType() const override
58  { return Superclass::VERTEX_CELL; }
59  void MakeCopy(CellAutoPointer &) const override;
61 
62  unsigned int GetDimension() const override;
63 
64  unsigned int GetNumberOfPoints() const override;
65 
66  CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override;
67 
68  bool GetBoundaryFeature(int dimension, CellFeatureIdentifier,
69  CellAutoPointer &) override;
70  void SetPointIds(PointIdConstIterator first) override;
71 
72  void SetPointIds(PointIdConstIterator first,
73  PointIdConstIterator last) override;
74 
75  void SetPointId(int localId, PointIdentifier) override;
76  PointIdIterator PointIdsBegin() override;
77 
78  PointIdConstIterator PointIdsBegin() const override;
79 
80  PointIdIterator PointIdsEnd() override;
81 
82  PointIdConstIterator PointIdsEnd() const override;
83 
85  virtual void SetPointId(PointIdentifier);
86  virtual PointIdentifier GetPointId();
88 
90  itkCellVisitMacro(Superclass::VERTEX_CELL);
91 
93  bool EvaluatePosition(CoordRepType *,
94  PointsContainer *,
95  CoordRepType *,
96  CoordRepType[],
97  double *,
98  InterpolationWeightType *) override;
99 
100 public:
102  {
103  for ( PointIdentifier i = 0; i < Self::NumberOfPoints; i++ )
104  {
105  m_PointIds[i] = NumericTraits< PointIdentifier >::max();
106  }
107  }
108 
109  ~VertexCell() override = default;
110 
111 protected:
115  PointIdentifier m_PointIds[NumberOfPoints];
116 };
117 } // end namespace itk
118 
119 #ifndef ITK_MANUAL_INSTANTIATION
120 #include "itkVertexCell.hxx"
121 #endif
122 
123 #endif
Define numeric traits for std::vector.
An abstract interface for cells.
#define itkCellCommonTypedefs(celltype)
CellGeometry GetType() const override
Definition: itkVertexCell.h:57
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
#define itkCellVisitMacro(TopologyId)
#define itkCellInheritedTypedefs(superclassArg)