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

Method SubdivideLeaves

Filters/Sources/vtkRandomHyperTreeGridSource.cxx:295–322  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

293
294//------------------------------------------------------------------------------
295void vtkRandomHyperTreeGridSource::SubdivideLeaves(
296 vtkHyperTreeGridNonOrientedCursor* cursor, vtkIdType treeId)
297{
298 vtkIdType vertexId = cursor->GetVertexId();
299 vtkHyperTree* tree = cursor->GetTree();
300 vtkIdType idx = tree->GetGlobalIndexFromLocal(vertexId);
301 vtkIdType level = cursor->GetLevel();
302 this->Levels->InsertValue(idx, level);
303 cursor->SetMask(false);
304 if (cursor->IsLeaf())
305 {
306 if (this->ShouldRefine(level))
307 {
308 cursor->SubdivideLeaf();
309 this->SubdivideLeaves(cursor, treeId);
310 }
311 }
312 else
313 {
314 int numChildren = cursor->GetNumberOfChildren();
315 for (int childIdx = 0; childIdx < numChildren; ++childIdx)
316 {
317 cursor->ToChild(childIdx);
318 this->SubdivideLeaves(cursor, treeId);
319 cursor->ToParent();
320 }
321 }
322}
323
324//------------------------------------------------------------------------------
325bool vtkRandomHyperTreeGridSource::ShouldRefine(vtkIdType level)

Callers 1

RequestDataMethod · 0.95

Calls 12

ShouldRefineMethod · 0.95
GetVertexIdMethod · 0.45
GetTreeMethod · 0.45
GetLevelMethod · 0.45
InsertValueMethod · 0.45
SetMaskMethod · 0.45
IsLeafMethod · 0.45
SubdivideLeafMethod · 0.45
GetNumberOfChildrenMethod · 0.45
ToChildMethod · 0.45
ToParentMethod · 0.45

Tested by

no test coverage detected