ITK  6.0.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{
35template <typename TCellInterface>
36class ITK_TEMPLATE_EXPORT PolyLineCell : public TCellInterface
37{
38public:
39 ITK_DISALLOW_COPY_AND_MOVE(PolyLineCell);
40
43 itkCellInheritedTypedefs(TCellInterface);
47 itkOverrideGetNameOfClassMacro(PolyLineCell);
48
51 using VertexAutoPointer = typename VertexType::SelfAutoPointer;
52
54 static constexpr unsigned int CellDimension = 1;
55
58 GetType() const override
59 {
61 }
62 void
63 MakeCopy(CellAutoPointer &) const override;
66 unsigned int
67 GetDimension() const override;
68
69 unsigned int
70 GetNumberOfPoints() const override;
71
72 CellFeatureCount
73 GetNumberOfBoundaryFeatures(int dimension) const override;
74
75 bool
76 GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
77
78 void
80
81 void
83
84 void
85 SetPointIds(PointIdConstIterator first) override;
86
87 void
88 SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
89
90 void
91 SetPointIds(int dummy, int num, PointIdConstIterator first);
92
93 void
94 SetPointId(int localId, PointIdentifier) override;
95 PointIdIterator
96 PointIdsBegin() override;
97
98 PointIdConstIterator
99 PointIdsBegin() const override;
100
101 PointIdIterator
102 PointIdsEnd() override;
103
104 PointIdConstIterator
105 PointIdsEnd() const override;
106
108 virtual CellFeatureCount
110
111 virtual bool
112 GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
113
116
117 void
118 InitializePoints(PointIdentifier numberOfPoints)
119 {
120 m_PointIds.clear();
121 for (PointIdentifier i = 0; i < numberOfPoints; ++i)
122 {
123 m_PointIds.push_back(NumericTraits<PointIdentifier>::max());
124 }
125 }
126
128 PolyLineCell() { InitializePoints(2); }
129
130 PolyLineCell(PointIdentifier numberOfPoints) { InitializePoints(numberOfPoints); }
131
132 ~PolyLineCell() override = default;
133
134protected:
136 std::vector<PointIdentifier> m_PointIds{};
137};
138} // end namespace itk
139
140#ifndef ITK_MANUAL_INSTANTIATION
141# include "itkPolyLineCell.hxx"
142#endif
143
144#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:38
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....