Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
        private long PopScanbeam()
        {
            Contract.Requires(_scanbeam != null);

            var y = _scanbeam.Y;
            _scanbeam = _scanbeam.Next;
            return y;
        }
Ejemplo n.º 4
0
 public Scanbeam(long y, Scanbeam next)
 {
     Y = y;
     Next = next;
 }