------------------------------------------------------------------------------
| 526 | |
| 527 | //------------------------------------------------------------------------------ |
| 528 | void vtkXMLUtilities::FactorElements(vtkXMLDataElement* tree) |
| 529 | { |
| 530 | if (!tree) |
| 531 | { |
| 532 | return; |
| 533 | } |
| 534 | |
| 535 | // Create the factored pool, and add it to the tree so that it can |
| 536 | // factor itself too |
| 537 | |
| 538 | vtkXMLDataElement* pool = vtkXMLDataElement::New(); |
| 539 | pool->SetName(VTK_XML_UTILITIES_FACTORED_POOL_NAME); |
| 540 | pool->SetAttributeEncoding(tree->GetAttributeEncoding()); |
| 541 | tree->AddNestedElement(pool); |
| 542 | |
| 543 | // Factor the tree, as long as some factorization has occurred |
| 544 | // (multiple pass might be needed because larger trees are factored |
| 545 | // first) |
| 546 | |
| 547 | while (vtkXMLUtilities::FactorElementsInternal(tree, tree, pool)) |
| 548 | { |
| 549 | } |
| 550 | |
| 551 | // Nothing factored, remove the useless pool |
| 552 | |
| 553 | if (!pool->GetNumberOfNestedElements()) |
| 554 | { |
| 555 | tree->RemoveNestedElement(pool); |
| 556 | } |
| 557 | |
| 558 | pool->Delete(); |
| 559 | } |
| 560 | |
| 561 | //------------------------------------------------------------------------------ |
| 562 | int vtkXMLUtilities::FactorElementsInternal( |
nothing calls this directly
no test coverage detected