ITK  5.2.0
Insight Toolkit
itkLineCell.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 itkLineCell_h
19 #define itkLineCell_h
20 
21 #include "itkVertexCell.h"
22 
23 namespace itk
24 {
41 template <typename TCellInterface>
42 class ITK_TEMPLATE_EXPORT LineCell : public TCellInterface
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_MOVE(LineCell);
46 
49  itkCellInheritedTypedefs(TCellInterface);
51 
53  itkTypeMacro(LineCell, CellInterface);
54 
57  using VertexAutoPointer = typename VertexType::SelfAutoPointer;
58 
60  static constexpr unsigned int NumberOfPoints = 2;
61  static constexpr unsigned int NumberOfVertices = 2;
62  static constexpr unsigned int CellDimension = 1;
63 
66  GetType() const override
67  {
69  }
70  void
71  MakeCopy(CellAutoPointer &) const override;
73 
74  unsigned int
75  GetDimension() const override;
76 
77  unsigned int
78  GetNumberOfPoints() const override;
79 
80  CellFeatureCount
81  GetNumberOfBoundaryFeatures(int dimension) const override;
82 
83  bool
84  GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
85  void
86  SetPointIds(PointIdConstIterator first) override;
87 
88  void
89  SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
90 
91  void
92  SetPointId(int localId, PointIdentifier) override;
93  PointIdIterator
94  PointIdsBegin() override;
95 
96  PointIdConstIterator
97  PointIdsBegin() const override;
98 
99  PointIdIterator
100  PointIdsEnd() override;
101 
102  PointIdConstIterator
103  PointIdsEnd() const override;
104 
106  virtual CellFeatureCount
107  GetNumberOfVertices() const;
108 
109  virtual bool
110  GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
111 
114 
116  {
117  for (unsigned int i = 0; i < Self::NumberOfPoints; i++)
118  {
119  m_PointIds[i] = NumericTraits<PointIdentifier>::max();
120  }
121  }
122 
123  ~LineCell() override = default;
124 
125 protected:
127  PointIdentifier m_PointIds[NumberOfPoints];
128 };
129 } // end namespace itk
130 
131 #ifndef ITK_MANUAL_INSTANTIATION
132 # include "itkLineCell.hxx"
133 #endif
134 
135 #endif
itk::LineCell::VertexAutoPointer
typename VertexType::SelfAutoPointer VertexAutoPointer
Definition: itkLineCell.h:57
itk::VertexCell
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
itk::LineCell::LineCell
LineCell()
Definition: itkLineCell.h:115
itk::LineCell::GetType
CellGeometryEnum GetType() const override
Definition: itkLineCell.h:66
itk::CommonEnums::CellGeometry::LINE_CELL
itkCellVisitMacro
#define itkCellVisitMacro(TopologyId)
Definition: itkCellInterface.h:32
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
itkVertexCell.h
itk::CellInterface
An abstract interface for cells.
Definition: itkCellInterface.h:96
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkCellCommonTypedefs
#define itkCellCommonTypedefs(celltype)
Definition: itkCellInterface.h:46