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

Method Reduce

Common/DataModel/vtkCellTreeLocator.cxx:619–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617 }
618
619 void Reduce()
620 {
621 this->Tree.Nodes.resize(this->Nodes.size());
622 this->Tree.Nodes[0] = this->Nodes[0];
623
624 for (auto ni = this->Tree.Nodes.begin(), nn = this->Tree.Nodes.begin() + 1;
625 ni != this->Tree.Nodes.end(); ++ni)
626 {
627 if (ni->IsLeaf())
628 {
629 continue;
630 }
631
632 *(nn++) = this->Nodes[ni->GetLeftChildIndex()];
633 *(nn++) = this->Nodes[ni->GetRightChildIndex()];
634 ni->SetChildren(nn - this->Tree.Nodes.begin() - 2);
635 }
636
637 const auto numberOfCells = static_cast<size_t>(this->DataSet->GetNumberOfCells());
638 this->Tree.Leaves.resize(numberOfCells);
639 for (size_t i = 0; i < numberOfCells; ++i)
640 {
641 this->Tree.Leaves[i] = this->CellsInfo[i].Ind;
642 }
643 this->CellsInfo.clear();
644 }
645};
646
647//------------------------------------------------------------------------------

Callers 1

BuildLocatorInternalMethod · 0.45

Calls 10

GetLeftChildIndexMethod · 0.80
GetRightChildIndexMethod · 0.80
SetChildrenMethod · 0.80
resizeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
IsLeafMethod · 0.45
GetNumberOfCellsMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected