vtkThreshold using non-thread safe cell access
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Change to vtkThreshold to use vtkGenericCell -
// :ADSK: JNH, include to fix thread safety issues #include "vtkSmartPointer.h" #include "vtkGenericCell.h"
...
int vtkThreshold::RequestData( vtkInformation *vtkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector) { ...
// :ADSK: JNH, allocate generic cell, so this filter works in parallel threads auto genericCell = vtkSmartPointer::New () ;
// Check that the scalars of each cell satisfy the threshold criterion for (cellId=0; cellId < input->GetNumberOfCells(); cellId++) { // :ADSK: JNH, get cell via copy input->GetCell(cellId, genericCell); cell=genericCell; ...
// special handling for polyhedron cells
// :ADSK: don't use input->GetCellType, use cell->GetCellType, local copy
if (vtkUnstructuredGrid::SafeDownCast(input) &&
cell->GetCellType() == VTK_POLYHEDRON)
...