Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions Modules/Core/Common/include/itkPolyLineCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class ITK_TEMPLATE_EXPORT PolyLineCell : public TCellInterface
bool
GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;

void
InitializePoints();

void
ClearPoints();

Expand Down Expand Up @@ -114,16 +117,21 @@ class ITK_TEMPLATE_EXPORT PolyLineCell : public TCellInterface
/** Visitor interface */
itkCellVisitMacro(CellGeometryEnum::LINE_CELL);

/** Constructor and destructor */
PolyLineCell() = default;
PolyLineCell(PointIdentifier NumberOfPoints)
void
InitializePoints(PointIdentifier numberOfPoints)
{
for (PointIdentifier i = 0; i < NumberOfPoints; ++i)
m_PointIds.clear();
for (PointIdentifier i = 0; i < numberOfPoints; ++i)
{
m_PointIds.push_back(NumericTraits<PointIdentifier>::max());
}
}

/** Constructor and destructor */
PolyLineCell() { InitializePoints(2); }

PolyLineCell(PointIdentifier numberOfPoints) { InitializePoints(numberOfPoints); }

~PolyLineCell() override = default;

protected:
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkPolyLineCell.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ template <typename TCellInterface>
void
PolyLineCell<TCellInterface>::ClearPoints()
{
m_PointIds.clear();
InitializePoints(2);
}


Expand Down