DeepCopy of DataSet does not copy cells.

I’m writing a ParaView filter in Python, and I need the output dataset to have the same topology and attributes as the input; only the point coordinates should to be modified. So I’m starting with this:

input = vtkDataSet.GetData(inInfoVec[0], 0)
output = vtkPolyData.GetData(outInfoVec, 0)

However, when I inspect the output afterwards, it looks like all points and their attributes get copied, all the cells are lost.

Is this the expected behavior of DeepCopy? And if so, what should I use to make a complete copy?

I suspect your input dataset is not a vtkPolyData. In that case the vtkPointSet::DeepCopy will be executed but no cells will be copied. You can use vtkGeometryFilter to convert the input to vtkPolyData

Ah, you were right: the input dataset turned out to be a vtkUnstructuredGrid.