44 vtkInformation *vtkNotUsed(request),
45 vtkInformationVector **inputVector,
46 vtkInformationVector *outputVector)
48 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
49 vtkInformation *outInfo = outputVector->GetInformationObject(0);
51 vtkPolyData *input = vtkPolyData::SafeDownCast(
52 inInfo->Get(vtkDataObject::DATA_OBJECT()));
53 vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(
54 outInfo->Get(vtkDataObject::DATA_OBJECT()));
56 output->SetPoints(input->GetPoints());
57 output->GetPointData()->PassData(input->GetPointData());
58 output->GetCellData()->PassData(input->GetCellData());
60 vtkCellArray* cellArray = vtkCellArray::New();
62 int numberOfCells = input->GetNumberOfCells();
66 int* cellTypes =
new int[numberOfCells];
71 for (
int i=0; i<numberOfCells; i++)
73 input->GetCellPoints(i,npts,pts);
74 cellType = input->GetCellType(i);
76 cellArray->InsertNextCell(npts,pts);
77 cellTypes[i] = cellType;
80 output->SetCells(cellTypes,cellArray);