Skip to content

Commit

Permalink
ENH: Adding test for itk::PolyLineCell
Browse files Browse the repository at this point in the history
  • Loading branch information
PranjalSahu authored and thewtex committed Sep 12, 2022
1 parent 5586157 commit d56e249
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
1 change: 0 additions & 1 deletion test/itkMeshToPolyDataFilterTest.cxx
Expand Up @@ -100,7 +100,6 @@ int itkMeshToPolyDataFilterTest( int argc, char * argv[] )
ITK_TEST_EXPECT_TRUE( itk::Math::FloatAlmostEqual< float >( points->GetElement( 0 )[2], 0.0, 10, 1e-4 ) );

ITK_TEST_EXPECT_EQUAL( polyData->GetVertices()->size(), 0 );

ITK_TEST_EXPECT_EQUAL( polyData->GetLines()->size(), 0 );

ITK_TEST_EXPECT_EQUAL( polyData->GetPolygons()->size(), 15593 );
Expand Down
21 changes: 12 additions & 9 deletions test/itkPolyDataToMeshFilterTest.cxx
Expand Up @@ -70,9 +70,10 @@ itkPolyDataToMeshFilterTest(int, char *[])

// Verify line cells
meshResult->GetCell(2, cellPtr);
ITK_TEST_EXPECT_EQUAL(cellPtr->GetNumberOfPoints(), 2);
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[0], 4);
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[1], 5);
ITK_TEST_EXPECT_EQUAL(cellPtr->GetNumberOfPoints(), 3);
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[0], 3);
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[1], 4);
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[2], 5);
meshResult->GetCell(3, cellPtr);
ITK_TEST_EXPECT_EQUAL(cellPtr->GetNumberOfPoints(), 2);
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[0], 7);
Expand Down Expand Up @@ -142,12 +143,14 @@ MakePolyDataSample(itk::PolyData<TPixelType> * polyData)
polyData->SetVertices(vertices);

typename CellContainerType::Pointer lines = CellContainerType::New();
lines->InsertElement(0, 2);
lines->InsertElement(1, 4);
lines->InsertElement(2, 5);
lines->InsertElement(3, 2);
lines->InsertElement(4, 7);
lines->InsertElement(5, 8);
lines->InsertElement(0, 3);
lines->InsertElement(1, 3);
lines->InsertElement(2, 4);
lines->InsertElement(3, 5);

lines->InsertElement(4, 2);
lines->InsertElement(5, 7);
lines->InsertElement(6, 8);
polyData->SetLines(lines);

typename CellContainerType::Pointer strips = CellContainerType::New();
Expand Down

0 comments on commit d56e249

Please sign in to comment.