------------------------------------------------------------------------------
| 262 | |
| 263 | //------------------------------------------------------------------------------ |
| 264 | int vtkSimpleScalarTree::FindNextLeaf(vtkIdType childIndex, int childLevel) |
| 265 | { |
| 266 | vtkIdType myIndex = (childIndex - 1) / this->BranchingFactor; |
| 267 | int myLevel = childLevel - 1; |
| 268 | vtkIdType firstChildIndex, childNum, index; |
| 269 | |
| 270 | // Find which child invoked this method |
| 271 | firstChildIndex = myIndex * this->BranchingFactor + 1; |
| 272 | childNum = childIndex - firstChildIndex; |
| 273 | |
| 274 | for (childNum++; childNum < this->BranchingFactor; childNum++) |
| 275 | { |
| 276 | index = firstChildIndex + childNum; |
| 277 | if (index >= this->TreeSize) |
| 278 | { |
| 279 | this->TreeIndex = this->TreeSize; |
| 280 | return 0; |
| 281 | } |
| 282 | else if (this->FindStartLeaf(index, childLevel)) |
| 283 | { |
| 284 | return 1; |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | // If here, didn't find anything yet |
| 289 | if (myLevel <= 0) // at root, can't go any higher in tree |
| 290 | { |
| 291 | this->TreeIndex = this->TreeSize; |
| 292 | return 0; |
| 293 | } |
| 294 | else |
| 295 | { |
| 296 | return this->FindNextLeaf(myIndex, myLevel); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | //------------------------------------------------------------------------------ |
| 301 | // Return the next cell that may contain scalar value specified to |
no test coverage detected