| 528 | } |
| 529 | |
| 530 | const char* vtkGenerateStatistics::GetAttributeArrayName(int nn) |
| 531 | { |
| 532 | vtkDataObject* dobj = this->GetInputDataObject(0, 0); // First input is always the leader |
| 533 | if (!dobj) |
| 534 | { |
| 535 | return nullptr; |
| 536 | } |
| 537 | |
| 538 | if (auto* cellGrid = vtkCellGrid::SafeDownCast(dobj)) |
| 539 | { |
| 540 | auto ids = cellGrid->GetUnorderedCellAttributeIds(); |
| 541 | if (nn < 0 || nn >= static_cast<int>(ids.size())) |
| 542 | { |
| 543 | return nullptr; |
| 544 | } |
| 545 | auto* cellAtt = cellGrid->GetCellAttributeById(ids[nn]); |
| 546 | return cellAtt ? cellAtt->GetName().Data().c_str() : nullptr; |
| 547 | } |
| 548 | |
| 549 | vtkFieldData* fdata = dobj->GetAttributesAsFieldData(this->AttributeMode); |
| 550 | if (!fdata) |
| 551 | { |
| 552 | return nullptr; |
| 553 | } |
| 554 | |
| 555 | int numArrays = fdata->GetNumberOfArrays(); |
| 556 | if (nn < 0 || nn > numArrays) |
| 557 | { |
| 558 | return nullptr; |
| 559 | } |
| 560 | |
| 561 | vtkAbstractArray* arr = fdata->GetAbstractArray(nn); |
| 562 | if (!arr) |
| 563 | { |
| 564 | return nullptr; |
| 565 | } |
| 566 | |
| 567 | return arr->GetName(); |
| 568 | } |
| 569 | |
| 570 | int vtkGenerateStatistics::GetAttributeArrayStatus(const char* arrName) |
| 571 | { |
nothing calls this directly
no test coverage detected