| 2541 | } |
| 2542 | |
| 2543 | bool vtkIOSSReaderInternal::GetGlobalFields(vtkDataArraySelection* globalFieldSelection, |
| 2544 | vtkFieldData* fd, const DatabaseHandle& handle, int timestep) |
| 2545 | { |
| 2546 | auto region = this->GetRegion(handle); |
| 2547 | if (!region) |
| 2548 | { |
| 2549 | return false; |
| 2550 | } |
| 2551 | |
| 2552 | Ioss::NameList fieldNames; |
| 2553 | region->field_describe(&fieldNames); |
| 2554 | for (const auto& name : fieldNames) |
| 2555 | { |
| 2556 | switch (region->get_fieldref(name).get_role()) |
| 2557 | { |
| 2558 | case Ioss::Field::ATTRIBUTE: |
| 2559 | case Ioss::Field::REDUCTION: |
| 2560 | if (globalFieldSelection->ArrayIsEnabled(name.c_str())) |
| 2561 | { |
| 2562 | if (auto array = this->GetField(name, region, region, handle, timestep)) |
| 2563 | { |
| 2564 | fd->AddArray(array); |
| 2565 | } |
| 2566 | } |
| 2567 | break; |
| 2568 | default: |
| 2569 | break; |
| 2570 | } |
| 2571 | } |
| 2572 | return true; |
| 2573 | } |
| 2574 | |
| 2575 | VTK_ABI_NAMESPACE_END |
no test coverage detected