| 3530 | } |
| 3531 | |
| 3532 | internal string ToStringInternal(int idx, int level) |
| 3533 | { |
| 3534 | string result = "", padding = "", plural = "s"; |
| 3535 | if (_childs.Count == 1) plural = ""; |
| 3536 | padding = padding.PadLeft(level * 2); |
| 3537 | if ((level & 1) == 0) |
| 3538 | result += $"{padding}+- hole ({idx}) contains {_childs.Count} nested polygon{plural}.\n"; |
| 3539 | else |
| 3540 | result += $"{padding}+- polygon ({idx}) contains {_childs.Count} hole{plural}.\n"; |
| 3541 | |
| 3542 | for (int i = 0; i < Count; i++) |
| 3543 | if (_childs[i].Count > 0) |
| 3544 | result += _childs[i].ToStringInternal(i, level +1); |
| 3545 | return result; |
| 3546 | } |
| 3547 | |
| 3548 | public override string ToString() |
| 3549 | { |