protected override void Reset() { base.Reset(); _scanbeam = null; _activeEdges = null; _sortedEdges = null; DisposeAllPolyPts(); var lm = MinimaList; while (lm != null) { InsertScanbeam(lm.Y); lm = lm.Next; } }
private void InsertScanbeam(long y) { if (_scanbeam == null) { _scanbeam = new Scanbeam(y, null); } else if (y > _scanbeam.Y) { var newSb = new Scanbeam(y, _scanbeam); _scanbeam = newSb; } else { var sb2 = _scanbeam; while (sb2.Next != null && (y <= sb2.Next.Y)) sb2 = sb2.Next; if (y == sb2.Y) return; //ie ignores duplicates var newSb = new Scanbeam(y, sb2.Next); sb2.Next = newSb; } }
private long PopScanbeam() { Contract.Requires(_scanbeam != null); var y = _scanbeam.Y; _scanbeam = _scanbeam.Next; return y; }
public Scanbeam(long y, Scanbeam next) { Y = y; Next = next; }