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

Function RecursivelyMaskGhost

Filters/HyperTree/vtkHyperTreeGridRemoveGhostCells.cxx:23–55  ·  view source on GitHub ↗

* Recursively process the tree to mask ghost cells. Return true if the current cell has been * masked (i.e. already masked in inMask, ghost in inGhost, or all children masked and/or ghost). */

Source from the content-addressed store, hash-verified

21 * masked (i.e. already masked in inMask, ghost in inGhost, or all children masked and/or ghost).
22 */
23bool RecursivelyMaskGhost(
24 vtkHyperTreeGridNonOrientedCursor* cursor, vtkBitArray* inMask, vtkUnsignedCharArray* inGhost)
25{
26 vtkIdType currentId = cursor->GetGlobalNodeIndex();
27 cursor->SetMask(false);
28
29 if (inMask && inMask->GetValue(currentId))
30 {
31 cursor->SetMask(true);
32 return true;
33 }
34
35 if (inGhost->GetTuple1(currentId))
36 {
37 cursor->SetMask(true);
38 return true;
39 }
40
41 bool allGhostOrMasked = false;
42 if (!cursor->IsLeaf())
43 {
44 for (int child = 0; child < cursor->GetNumberOfChildren(); ++child)
45 {
46 cursor->ToChild(child);
47 // Coarse cell is masked if it contains only ghosts and/or masked children
48 allGhostOrMasked = allGhostOrMasked && RecursivelyMaskGhost(cursor, inMask, inGhost);
49 cursor->ToParent();
50 }
51 }
52
53 cursor->SetMask(allGhostOrMasked);
54 return allGhostOrMasked;
55}
56}
57
58//------------------------------------------------------------------------------

Callers 1

ProcessTreesMethod · 0.85

Calls 8

GetTuple1Method · 0.80
GetGlobalNodeIndexMethod · 0.45
SetMaskMethod · 0.45
GetValueMethod · 0.45
IsLeafMethod · 0.45
GetNumberOfChildrenMethod · 0.45
ToChildMethod · 0.45
ToParentMethod · 0.45

Tested by

no test coverage detected