ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLineCell.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 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_ASSIGN(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 
65  CellGeometry GetType() const override
66  { return Superclass::LINE_CELL; }
67  void MakeCopy(CellAutoPointer &) const override;
69 
70  unsigned int GetDimension() const override;
71 
72  unsigned int GetNumberOfPoints() const override;
73 
74  CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override;
75 
76  bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
77  void SetPointIds(PointIdConstIterator first) override;
78 
79  void SetPointIds(PointIdConstIterator first,
80  PointIdConstIterator last) override;
81 
82  void SetPointId(int localId, PointIdentifier) override;
83  PointIdIterator PointIdsBegin() override;
84 
85  PointIdConstIterator PointIdsBegin() const override;
86 
87  PointIdIterator PointIdsEnd() override;
88 
89  PointIdConstIterator PointIdsEnd() const override;
90 
92  virtual CellFeatureCount GetNumberOfVertices() const;
93 
94  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
95 
97  itkCellVisitMacro(Superclass::LINE_CELL);
98 
100  {
101  for ( unsigned int i = 0; i < Self::NumberOfPoints; i++ )
102  {
103  m_PointIds[i] = NumericTraits< PointIdentifier >::max();
104  }
105  }
106 
107  ~LineCell() override = default;
108 
109 protected:
111  PointIdentifier m_PointIds[NumberOfPoints];
112 };
113 } // end namespace itk
114 
115 #ifndef ITK_MANUAL_INSTANTIATION
116 #include "itkLineCell.hxx"
117 #endif
118 
119 #endif
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
CellGeometry GetType() const override
Definition: itkLineCell.h:65
Define numeric traits for std::vector.
An abstract interface for cells.
#define itkCellCommonTypedefs(celltype)
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
#define itkCellVisitMacro(TopologyId)
typename VertexType::SelfAutoPointer VertexAutoPointer
Definition: itkLineCell.h:57
#define itkCellInheritedTypedefs(superclassArg)