------------------------------------------------------------------------------
| 510 | |
| 511 | //------------------------------------------------------------------------------ |
| 512 | void vtkDataObjectMeshCache::ForwardAttributesToComposite( |
| 513 | vtkCompositeDataSet* input, vtkCompositeDataSet* output) |
| 514 | { |
| 515 | auto inputDataTree = vtkDataObjectTree::SafeDownCast(input); |
| 516 | auto outputDataTree = vtkDataObjectTree::SafeDownCast(output); |
| 517 | auto cacheDataTree = vtkDataObjectTree::SafeDownCast(this->Cache); |
| 518 | |
| 519 | if (!inputDataTree || !outputDataTree || !cacheDataTree) |
| 520 | { |
| 521 | vtkWarningMacro("Only vtkDataObjectTree are supported for now"); |
| 522 | return; |
| 523 | } |
| 524 | |
| 525 | auto options = vtk::DataObjectTreeOptions::TraverseSubTree | |
| 526 | vtk::DataObjectTreeOptions::SkipEmptyNodes | vtk::DataObjectTreeOptions::VisitOnlyLeaves; |
| 527 | auto inputDataRange = vtk::Range(inputDataTree, options); |
| 528 | auto outputDataRange = vtk::Range(outputDataTree, options); |
| 529 | auto cacheDataRange = vtk::Range(cacheDataTree, options); |
| 530 | |
| 531 | auto inputBlock = inputDataRange.begin(); |
| 532 | auto outputBlock = outputDataRange.begin(); |
| 533 | auto cacheBlock = cacheDataRange.begin(); |
| 534 | while (outputBlock != outputDataRange.end() && inputBlock != inputDataRange.end() && |
| 535 | cacheBlock != cacheDataRange.end()) |
| 536 | { |
| 537 | auto inputDataSet = vtkDataSet::SafeDownCast(*inputBlock); |
| 538 | auto outputDataSet = vtkDataSet::SafeDownCast(*outputBlock); |
| 539 | auto cacheDataSet = vtkDataSet::SafeDownCast(*cacheBlock); |
| 540 | if (outputDataSet && cacheDataSet) |
| 541 | { |
| 542 | this->ForwardAttributesToDataSet(inputDataSet, cacheDataSet, outputDataSet); |
| 543 | } |
| 544 | |
| 545 | cacheBlock++; |
| 546 | outputBlock++; |
| 547 | inputBlock++; |
| 548 | } |
| 549 | |
| 550 | outputDataTree->GetFieldData()->PassData(inputDataTree->GetFieldData()); |
| 551 | } |
| 552 | |
| 553 | //------------------------------------------------------------------------------ |
| 554 | void vtkDataObjectMeshCache::ForwardAttributes( |
no test coverage detected