Commit 0131a540 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Update VTK to fix performance issues with FieldList.

addresses #18550.
parent a5c38565
......@@ -167,31 +167,28 @@ static void vtkAttributeDataReductionFilterReduce(vtkDataSetAttributes* output,
if (dsa->GetNumberOfArrays() > 0 && dsa->GetNumberOfTuples() == numTuples)
{
// Now combine this inPD with the outPD using the reduction indicated.
for (int i = 0; i < fieldList.GetNumberOfFields(); ++i)
{
if (fieldList.GetFieldIndex(i) >= 0)
auto f = [list_index, progress_offset, progress_factor, self](
vtkAbstractArray* fromA, vtkAbstractArray* toA) {
vtkDataArray* toDA = vtkDataArray::SafeDownCast(toA);
vtkDataArray* fromDA = vtkDataArray::SafeDownCast(fromA);
if (!toDA || !fromDA)
{
vtkDataArray* toDA = output->GetArray(fieldList.GetFieldIndex(i));
vtkDataArray* fromDA = dsa->GetArray(fieldList.GetDSAIndex(list_index, i));
if (!toDA || !fromDA)
{
continue;
}
vtkSmartPointer<vtkArrayIterator> toIter;
toIter.TakeReference(toDA->NewIterator());
vtkSmartPointer<vtkArrayIterator> fromIter;
fromIter.TakeReference(fromDA->NewIterator());
switch (toDA->GetDataType())
{
vtkArrayIteratorTemplateMacro(
vtkAttributeDataReductionFilterReduce(self, static_cast<VTK_TT*>(toIter.GetPointer()),
static_cast<VTK_TT*>(fromIter.GetPointer()), progress_offset, progress_factor));
default:
vtkGenericWarningMacro(
"Cannot reduce arrays of type: " << toDA->GetDataTypeAsString());
}
return;
}
}
vtkSmartPointer<vtkArrayIterator> toIter;
toIter.TakeReference(toDA->NewIterator());
vtkSmartPointer<vtkArrayIterator> fromIter;
fromIter.TakeReference(fromDA->NewIterator());
switch (toDA->GetDataType())
{
vtkArrayIteratorTemplateMacro(
vtkAttributeDataReductionFilterReduce(self, static_cast<VTK_TT*>(toIter.GetPointer()),
static_cast<VTK_TT*>(fromIter.GetPointer()), progress_offset, progress_factor));
default:
vtkGenericWarningMacro("Cannot reduce arrays of type: " << toDA->GetDataTypeAsString());
}
};
fieldList.TransformData(list_index, dsa, output, f);
list_index++;
}
......
Subproject commit e42c7c1ad568988da8baa0be5adda2e3dcfaacac
Subproject commit d43b072d7cd76490d47af76242f0bf1fd5d22a6a
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment