ITK  5.4.0
Insight Toolkit
itkPolyLineCell.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 * https://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 itkPolyLineCell_h
19#define itkPolyLineCell_h
20
21#include "itkVertexCell.h"
22namespace itk
23{
40template <typename TCellInterface>
41class ITK_TEMPLATE_EXPORT PolyLineCell : public TCellInterface
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(PolyLineCell);
45
48 itkCellInheritedTypedefs(TCellInterface);
52 itkOverrideGetNameOfClassMacro(PolyLineCell);
53
56 using VertexAutoPointer = typename VertexType::SelfAutoPointer;
57
59 static constexpr unsigned int CellDimension = 1;
60
63 GetType() const override
64 {
66 }
67 void
68 MakeCopy(CellAutoPointer &) const override;
71 unsigned int
72 GetDimension() const override;
73
74 unsigned int
75 GetNumberOfPoints() const override;
76
77 CellFeatureCount
78 GetNumberOfBoundaryFeatures(int dimension) const override;
79
80 bool
81 GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
82
83 void
85
86 void
88
89 void
90 SetPointIds(PointIdConstIterator first) override;
91
92 void
93 SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
94
95 void
96 SetPointIds(int dummy, int num, PointIdConstIterator first);
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
115
116 virtual bool
117 GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
118
121
122 void
123 InitializePoints(PointIdentifier numberOfPoints)
124 {
125 m_PointIds.clear();
126 for (PointIdentifier i = 0; i < numberOfPoints; ++i)
127 {
128 m_PointIds.push_back(NumericTraits<PointIdentifier>::max());
129 }
130 }
131
133 PolyLineCell() { InitializePoints(2); }
134
135 PolyLineCell(PointIdentifier numberOfPoints) { InitializePoints(numberOfPoints); }
136
137 ~PolyLineCell() override = default;
138
139protected:
141 std::vector<PointIdentifier> m_PointIds{};
142};
143} // end namespace itk
144
145#ifndef ITK_MANUAL_INSTANTIATION
146# include "itkPolyLineCell.hxx"
147#endif
148
149#endif
Define additional traits for native types such as int or float.
Represents a series of connected line segments for a Mesh.
PointIdConstIterator PointIdsBegin() const override
typename VertexType::SelfAutoPointer VertexAutoPointer
virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &)
void SetPointIds(int dummy, int num, PointIdConstIterator first)
PointIdConstIterator PointIdsEnd() const override
~PolyLineCell() override=default
itkCellCommonTypedefs(PolyLineCell)
bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override
itkCellInheritedTypedefs(TCellInterface)
void InitializePoints(PointIdentifier numberOfPoints)
CellGeometryEnum GetType() const override
itkCellVisitMacro(CellGeometryEnum::POLYLINE_CELL)
void MakeCopy(CellAutoPointer &) const override
PointIdIterator PointIdsBegin() override
unsigned int GetNumberOfPoints() const override
void SetPointIds(PointIdConstIterator first) override
PointIdIterator PointIdsEnd() override
void SetPointId(int localId, PointIdentifier) override
void SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override
CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override
unsigned int GetDimension() const override
PolyLineCell(PointIdentifier numberOfPoints)
virtual CellFeatureCount GetNumberOfVertices() const
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:43
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....