------------------------------------------------------------------------------
| 396 | |
| 397 | //------------------------------------------------------------------------------ |
| 398 | bool vtkRandomHyperTreeGridSource::ShouldMask( |
| 399 | double siblingsFractionMasked, int level, double errorMargin) |
| 400 | { |
| 401 | int levelWeight = std::max(1, static_cast<int>(level * this->MaxDepth)); |
| 402 | // We penalize the masking of high depth node since they are harder to attain. |
| 403 | // This allows to have more deep nodes unmasked. |
| 404 | return siblingsFractionMasked * levelWeight <= this->MaskedFraction - errorMargin; |
| 405 | } |
| 406 | |
| 407 | //------------------------------------------------------------------------------ |
| 408 | void vtkRandomHyperTreeGridSource::InitializeMaskingNodeCostPerLevel() |