vtkCutter overwrites cell scalars cutting cells of different dimension
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I think there is a problem colour mapping cell scalars using vtkCutter on an unstructured
grid. Take a grid with 2 cells, a hex and a quad, and cut both cells by a plane.
Cutting the hex creates 2 triangles - vtkHexahedron::Contour() calls
newCellId = polys->InsertNextCell(3,pts);
outCd->CopyData(inCd,cellId,newCellId);
creating new triangles with newCellId = 0 & 1.
Cutting the quad gives a single line - vtkQuad::Contour() calls
newCellId = lines->InsertNextCell(2,pts);
outCd->CopyData(inCd,cellId,newCellId);
creating a new line with newCellId = 0.
Unfortunately, the CopyData() in vtkQuad::Contour() overwrites the cell data for the first
triangle. On more complex geometries this causes the renderer to crash because the cell data
is not present.
I think the calls to copy the cell data need the new cell Id in the aggregate polydata, not
the individual lines or polys - something like
outCD->CopyData(inCd, cellId, vtkCutter->NumberOfNewCells++);