vtkIdType tenth;
vtkFloatingPointType decimal;
+ vtkIdType* pointMap = new vtkIdType[input->GetNumberOfPoints()];
+
vtkDebugMacro(<<"Shrinking cells");
numCells=input->GetNumberOfCells();
newId = newPts->InsertNextPoint(pt);
if(myStoreMapping)
myVTK2ObjIds.push_back(oldId);
- newPtIds->InsertId(i,newId);
outPD->CopyData(pd, oldId, newId);
+
+ pointMap[oldId] = newId;
+ }
+
+ // special handling for polyhedron cells
+ if (vtkUnstructuredGrid::SafeDownCast(input) &&
+ input->GetCellType(cellId) == VTK_POLYHEDRON)
+ {
+ vtkUnstructuredGrid::SafeDownCast(input)->GetFaceStream(cellId, newPtIds);
+ vtkUnstructuredGrid::ConvertFaceStreamPointIds(newPtIds, pointMap);
+ }
+ else
+ {
+ for(vtkIdType i=0; i < numIds; ++i)
+ {
+ newPtIds->InsertId(i, pointMap[ptIds->GetId(i)]);
+ }
}
output->InsertNextCell(input->GetCellType(cellId), newPtIds);
}//for all cells
ptIds->Delete();
newPtIds->Delete();
newPts->Delete();
+
+ delete [] pointMap;
return 1;
}