------------------------------------------------------------------------------
| 293 | |
| 294 | //------------------------------------------------------------------------------ |
| 295 | void 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 | //------------------------------------------------------------------------------ |
| 325 | bool vtkRandomHyperTreeGridSource::ShouldRefine(vtkIdType level) |
no test coverage detected