MCPcopy Create free account
hub / github.com/Kitware/VTK / FactorElements

Method FactorElements

IO/XMLParser/vtkXMLUtilities.cxx:528–559  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

526
527//------------------------------------------------------------------------------
528void 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//------------------------------------------------------------------------------
562int vtkXMLUtilities::FactorElementsInternal(

Callers

nothing calls this directly

Calls 6

AddNestedElementMethod · 0.80
RemoveNestedElementMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
SetNameMethod · 0.45

Tested by

no test coverage detected