| 45 | } |
| 46 | |
| 47 | int TestPolyDataCells(vtkPolyData* data, vtkPolyData* expectedData, unsigned int partitionId) |
| 48 | { |
| 49 | if (data->GetNumberOfCells() != expectedData->GetNumberOfCells()) |
| 50 | { |
| 51 | std::cerr << "For partition " << partitionId << ", expecting " |
| 52 | << expectedData->GetNumberOfCells() << " cells but got: " << data->GetNumberOfCells() |
| 53 | << std::endl; |
| 54 | return EXIT_FAILURE; |
| 55 | } |
| 56 | |
| 57 | vtkNew<vtkIdList> cellPoints; |
| 58 | vtkNew<vtkIdList> expectedCellPoints; |
| 59 | for (vtkIdType cellId = 0; cellId < data->GetNumberOfCells(); cellId++) |
| 60 | { |
| 61 | data->GetCellPoints(cellId, cellPoints); |
| 62 | expectedData->GetCellPoints(cellId, expectedCellPoints); |
| 63 | |
| 64 | if (cellPoints->GetNumberOfIds() != expectedCellPoints->GetNumberOfIds()) |
| 65 | { |
| 66 | std::cerr << "For partition " << partitionId << ", cell " << cellId << ", expecting " |
| 67 | << expectedCellPoints->GetNumberOfIds() << " points but got " |
| 68 | << cellPoints->GetNumberOfIds() << std::endl; |
| 69 | return EXIT_FAILURE; |
| 70 | } |
| 71 | |
| 72 | for (vtkIdType cellPointIndex = 0; cellPointIndex < cellPoints->GetNumberOfIds(); |
| 73 | cellPointIndex++) |
| 74 | { |
| 75 | if (cellPoints->GetId(cellPointIndex) != expectedCellPoints->GetId(cellPointIndex)) |
| 76 | { |
| 77 | std::cerr << "For partition " << partitionId << ", cell " << cellId |
| 78 | << ", expecting point ID " << expectedCellPoints->GetId(cellPointIndex) |
| 79 | << " but got " << cellPoints->GetId(cellPointIndex) << std::endl; |
| 80 | return EXIT_FAILURE; |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | return EXIT_SUCCESS; |
| 85 | } |
| 86 | |
| 87 | int TestPolyData(vtkPolyData* data, vtkPolyData* expectedData, unsigned int partitionId) |
| 88 | { |
no test coverage detected