---------------------------------------------------------------------------
| 401 | |
| 402 | //--------------------------------------------------------------------------- |
| 403 | void vtkHyperTree::SubdivideLeaf(vtkIdType index, unsigned int depth) |
| 404 | { |
| 405 | assert("pre: not_validindex" && index < static_cast<vtkIdType>(this->Datas->NumberOfVertices)); |
| 406 | assert("pre: not_leaf" && this->IsLeaf(index)); |
| 407 | // The leaf becomes a node and is not anymore a leaf |
| 408 | // Nodes get constructed with leaf flags set to 1. |
| 409 | if (static_cast<vtkIdType>(this->Datas->ParentToElderChild.size()) <= index) |
| 410 | { |
| 411 | this->Datas->ParentToElderChild.resize(index + 1, std::numeric_limits<unsigned int>::max()); |
| 412 | } |
| 413 | // The first new child |
| 414 | |
| 415 | this->Datas->ParentToElderChild[index] = static_cast<unsigned int>(this->Datas->NumberOfVertices); |
| 416 | // Add the new leaves to the number of leaves at the next depth. |
| 417 | if (depth + 1 == this->Datas->NumberOfLevels) // >= |
| 418 | { |
| 419 | // We have a new depth. |
| 420 | ++this->Datas->NumberOfLevels; |
| 421 | } |
| 422 | // Update the number of non-leaf and all vertices |
| 423 | this->Datas->NumberOfNodes += 1; |
| 424 | this->Datas->NumberOfVertices += this->NumberOfChildren; |
| 425 | } |
| 426 | |
| 427 | //--------------------------------------------------------------------------- |
| 428 | unsigned long vtkHyperTree::GetActualMemorySizeBytes() |