Commit 16ccdf23 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot

Merge topic 'perf-issues-with-field-list'

431051cb Update VTK to fix performance issues with FieldList.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Cory Quammen's avatarCory Quammen <cory.quammen@kitware.com>
Merge-request: !2855
parents 417bd2e1 431051cb
Pipeline #121992 failed with stage
in 0 seconds
......@@ -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 fbb540eea21f3b23232a5f402cd41066d11c6dc7
Subproject commit 1d2e1bfeb7cf1840768a91f305dfea95c4775244
Subproject commit 26eb4274a3b0af8d37e36d62bf5183a621f371ca
Subproject commit daa7a94fba63183655b038896090865d92b5e900
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