Depth first recursion to walk the tree in child order Used to create the breadth first BitArray descriptor appending node and leaf indicator by level
| 381 | // node and leaf indicator by level |
| 382 | // |
| 383 | void BuildDescriptor(vtkHyperTreeGridNonOrientedCursor* inCursor, int level, bool hasMask, |
| 384 | unsigned int numChildren, std::vector<std::string>& descriptor, std::vector<std::string>& mask) |
| 385 | { |
| 386 | // Append to mask string |
| 387 | if (hasMask) |
| 388 | { |
| 389 | if (inCursor->IsMasked()) |
| 390 | mask[level] += '1'; |
| 391 | else |
| 392 | mask[level] += '0'; |
| 393 | } |
| 394 | |
| 395 | // Append to descriptor string |
| 396 | if (!inCursor->IsLeaf()) |
| 397 | { |
| 398 | descriptor[level] += 'R'; |
| 399 | |
| 400 | // If input cursor is not a leaf, recurse to all children |
| 401 | for (unsigned int child = 0; child < numChildren; ++child) |
| 402 | { |
| 403 | // Move cursor to child |
| 404 | inCursor->ToChild(child); |
| 405 | |
| 406 | // Recurse |
| 407 | BuildDescriptor(inCursor, level + 1, hasMask, numChildren, descriptor, mask); |
| 408 | |
| 409 | // Move cursor back to parent |
| 410 | inCursor->ToParent(); |
| 411 | } // child |
| 412 | } |
| 413 | else |
| 414 | { |
| 415 | descriptor[level] += '.'; |
| 416 | } |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | //------------------------------------------------------------------------------ |
no test coverage detected