Skip to content

Commit

Permalink
BUG: Fix for wrong cell type when LINE and POLY_LINE present
Browse files Browse the repository at this point in the history
cellType was modified permanently for the rest of loop.
  • Loading branch information
PranjalSahu authored and dzenanz committed Aug 21, 2022
1 parent 2c8be69 commit b96dac6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Modules/IO/MeshBase/include/itkMeshIOBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -802,9 +802,12 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject
auto numberOfPoints = static_cast<unsigned int>(input[inputIndex++]);
if (numberOfPoints > 2 && cellType == CellGeometryEnum::LINE_CELL)
{
cellType = CellGeometryEnum::POLYLINE_CELL;
output[outputIndex++] = static_cast<TOutput>(CellGeometryEnum::POLYLINE_CELL);
}
else
{
output[outputIndex++] = static_cast<TOutput>(cellType);
}
output[outputIndex++] = static_cast<TOutput>(cellType);
output[outputIndex++] = static_cast<TOutput>(numberOfPoints);

for (unsigned int jj = 0; jj < numberOfPoints; ++jj)
Expand Down

0 comments on commit b96dac6

Please sign in to comment.