public void EnforceMinimumDepth() { if (_nodeDepth < _parentTree.MinimumDepth) { if (this.HasChildren) { _isActive = false; _isSplit = true; ChildTopLeft.EnforceMinimumDepth(); ChildTopRight.EnforceMinimumDepth(); ChildBottomLeft.EnforceMinimumDepth(); ChildBottomRight.EnforceMinimumDepth(); } else { this.Activate(); _isSplit = false; } return; } if (_nodeDepth == _parentTree.MinimumDepth || (_nodeDepth < _parentTree.MinimumDepth && !this.HasChildren)) { this.Activate(); _isSplit = false; } }
/// <summary> /// Force the quad tree to split to the minimum depth /// </summary> internal void EnforceMinimumDepth() { if (_nodeDepth < _parentTree.MinimumDepth) { if (HasChildren) { _isActive = false; _isSplit = true; ChildTopLeft.EnforceMinimumDepth(); ChildTopRight.EnforceMinimumDepth(); ChildBottomLeft.EnforceMinimumDepth(); ChildBottomRight.EnforceMinimumDepth(); } else { Activate(); _isSplit = false; } return; } if (_nodeDepth == _parentTree.MinimumDepth) { Activate(); _isSplit = false; } }