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

Method SubdivideLeaf

Common/DataModel/vtkHyperTree.cxx:403–425  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

401
402//---------------------------------------------------------------------------
403void vtkHyperTree::SubdivideLeaf(vtkIdType index, unsigned int depth)
404{
405 assert("pre: not_validindex" && index < static_cast<vtkIdType>(this->Datas->NumberOfVertices));
406 assert("pre: not_leaf" && this->IsLeaf(index));
407 // The leaf becomes a node and is not anymore a leaf
408 // Nodes get constructed with leaf flags set to 1.
409 if (static_cast<vtkIdType>(this->Datas->ParentToElderChild.size()) <= index)
410 {
411 this->Datas->ParentToElderChild.resize(index + 1, std::numeric_limits<unsigned int>::max());
412 }
413 // The first new child
414
415 this->Datas->ParentToElderChild[index] = static_cast<unsigned int>(this->Datas->NumberOfVertices);
416 // Add the new leaves to the number of leaves at the next depth.
417 if (depth + 1 == this->Datas->NumberOfLevels) // >=
418 {
419 // We have a new depth.
420 ++this->Datas->NumberOfLevels;
421 }
422 // Update the number of non-leaf and all vertices
423 this->Datas->NumberOfNodes += 1;
424 this->Datas->NumberOfVertices += this->NumberOfChildren;
425}
426
427//---------------------------------------------------------------------------
428unsigned long vtkHyperTree::GetActualMemorySizeBytes()

Calls 5

IsLeafMethod · 0.95
assertFunction · 0.50
maxFunction · 0.50
sizeMethod · 0.45
resizeMethod · 0.45

Tested by 9

handleNodeMethod · 0.36
handleNodeFunction · 0.36
handleNodeFunction · 0.36
generateQuadTreeHTGFunction · 0.36
generateOctreeHTGFunction · 0.36
generateTreeFunction · 0.36
CopyInputTreeToOutputFunction · 0.36
TestDifferentVolumesFunction · 0.36