Skip to content

Commit d56e249

Browse files
PranjalSahuthewtex
authored andcommitted
ENH: Adding test for itk::PolyLineCell
1 parent 5586157 commit d56e249

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

test/itkMeshToPolyDataFilterTest.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ int itkMeshToPolyDataFilterTest( int argc, char * argv[] )
100100
ITK_TEST_EXPECT_TRUE( itk::Math::FloatAlmostEqual< float >( points->GetElement( 0 )[2], 0.0, 10, 1e-4 ) );
101101

102102
ITK_TEST_EXPECT_EQUAL( polyData->GetVertices()->size(), 0 );
103-
104103
ITK_TEST_EXPECT_EQUAL( polyData->GetLines()->size(), 0 );
105104

106105
ITK_TEST_EXPECT_EQUAL( polyData->GetPolygons()->size(), 15593 );

test/itkPolyDataToMeshFilterTest.cxx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ itkPolyDataToMeshFilterTest(int, char *[])
7070

7171
// Verify line cells
7272
meshResult->GetCell(2, cellPtr);
73-
ITK_TEST_EXPECT_EQUAL(cellPtr->GetNumberOfPoints(), 2);
74-
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[0], 4);
75-
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[1], 5);
73+
ITK_TEST_EXPECT_EQUAL(cellPtr->GetNumberOfPoints(), 3);
74+
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[0], 3);
75+
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[1], 4);
76+
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[2], 5);
7677
meshResult->GetCell(3, cellPtr);
7778
ITK_TEST_EXPECT_EQUAL(cellPtr->GetNumberOfPoints(), 2);
7879
ITK_TEST_EXPECT_EQUAL(cellPtr->GetPointIdsContainer()[0], 7);
@@ -142,12 +143,14 @@ MakePolyDataSample(itk::PolyData<TPixelType> * polyData)
142143
polyData->SetVertices(vertices);
143144

144145
typename CellContainerType::Pointer lines = CellContainerType::New();
145-
lines->InsertElement(0, 2);
146-
lines->InsertElement(1, 4);
147-
lines->InsertElement(2, 5);
148-
lines->InsertElement(3, 2);
149-
lines->InsertElement(4, 7);
150-
lines->InsertElement(5, 8);
146+
lines->InsertElement(0, 3);
147+
lines->InsertElement(1, 3);
148+
lines->InsertElement(2, 4);
149+
lines->InsertElement(3, 5);
150+
151+
lines->InsertElement(4, 2);
152+
lines->InsertElement(5, 7);
153+
lines->InsertElement(6, 8);
151154
polyData->SetLines(lines);
152155

153156
typename CellContainerType::Pointer strips = CellContainerType::New();

0 commit comments

Comments
 (0)