------------------------------------------------------------------------------
| 52 | |
| 53 | //------------------------------------------------------------------------------ |
| 54 | vtkPointSet* vtkExplodeDataSet::CreatePartition(vtkDataSet* input, vtkIdList* partCellIds) |
| 55 | { |
| 56 | vtkPolyData* inputPD = vtkPolyData::SafeDownCast(input); |
| 57 | if (inputPD) |
| 58 | { |
| 59 | vtkPolyData* poly = vtkPolyData::New(); |
| 60 | poly->AllocateCopy(inputPD); |
| 61 | // use input nb of points as a max. Squeeze it later. |
| 62 | poly->GetPointData()->CopyAllocate(input->GetPointData(), input->GetNumberOfPoints()); |
| 63 | poly->GetCellData()->CopyAllocate(input->GetCellData(), partCellIds->GetNumberOfIds()); |
| 64 | poly->CopyCells(inputPD, partCellIds); |
| 65 | poly->Squeeze(); |
| 66 | return poly; |
| 67 | } |
| 68 | |
| 69 | vtkNew<vtkExtractCells> extraction; |
| 70 | extraction->SetInputData(input); |
| 71 | extraction->SetCellList(partCellIds); |
| 72 | extraction->Update(); |
| 73 | vtkUnstructuredGrid* ugrid = extraction->GetOutput(); |
| 74 | ugrid->Register(nullptr); |
| 75 | return ugrid; |
| 76 | } |
| 77 | |
| 78 | //------------------------------------------------------------------------------ |
| 79 | int vtkExplodeDataSet::RequestData(vtkInformation* vtkNotUsed(request), |
no test coverage detected