Recursive check for visible cells and propagate up visibility to parents
| 45 | |
| 46 | // Recursive check for visible cells and propagate up visibility to parents |
| 47 | bool SanitizeHTGMask(vtkHyperTreeGridNonOrientedCursor* cursor) |
| 48 | { |
| 49 | if (!cursor->IsLeaf()) |
| 50 | { |
| 51 | bool isMasked = cursor->IsMasked(); |
| 52 | if (isMasked) |
| 53 | { |
| 54 | cursor->SetMask(false); |
| 55 | } |
| 56 | bool checkLowerLevelVisible = false; |
| 57 | for (vtkIdType iChild = 0; iChild < cursor->GetNumberOfChildren(); ++iChild) |
| 58 | { |
| 59 | cursor->ToChild(iChild); |
| 60 | checkLowerLevelVisible = SanitizeHTGMask(cursor) || checkLowerLevelVisible; |
| 61 | cursor->ToParent(); |
| 62 | } |
| 63 | if (!checkLowerLevelVisible && isMasked) |
| 64 | { |
| 65 | cursor->SetMask(true); |
| 66 | } |
| 67 | } |
| 68 | return !cursor->IsMasked(); |
| 69 | } |
| 70 | |
| 71 | } |
| 72 |
no test coverage detected