Esempio n. 1
0
 public void Reset()
 {
     start_int = null;
     mid_int   = null;
     end_int   = null;
     midDegen  = false;
     Up        = null;
     Down      = null;
     useStart  = true;
     // TODO: Reset contPrev here too
     for (; contNext != null; contNext = contNext.contNext)
     {
         endPt = contNext.endPt;
     }
 }
Esempio n. 2
0
 public SingleLL(Segment i, SingleLL n)
 {
     item = i;
     next = n;
 }
Esempio n. 3
0
        private static void RecordEndIntersections(BundleTree oldEqTree, BundleTree newEqTree)
        {
            int      intCount = -1;
            SingleLL intptr   = null;
            Segment  prev     = null;

            for (Bundle bptr = oldEqTree.Top; bptr != null; bptr = bptr.PurpleDown)
            {
                for (Segment sptr = bptr.Top; sptr != null; sptr = sptr.Down)
                {
                    intCount++;
                    if (intptr == null)
                    {
                        intptr      = new SingleLL(sptr, null);
                        intptr.next = intptr;
                    }
                    else
                    {
                        intptr.next = new SingleLL(sptr, intptr.next);
                        intptr      = intptr.next;
                    }
                }
            }

            for (Bundle bptr = newEqTree.Bottom; bptr != null; bptr = bptr.PurpleUp)
            {
                for (Segment sptr = bptr.Bottom; sptr != null; sptr = sptr.Up)
                {
                    intCount++;
                    if (intptr == null)
                    {
                        intptr      = new SingleLL(sptr, null);
                        intptr.next = intptr;
                    }
                    else
                    {
                        intptr.next = new SingleLL(sptr, intptr.next);
                        intptr      = intptr.next;
                    }
                }
            }

            if (intCount <= 0)
            {
                return;
            }
            Debug.Assert(intptr != null);
            intptr = intptr.next;
            for (Bundle bptr = oldEqTree.Top; bptr != null; bptr = bptr.PurpleDown)
            {
                for (Segment sptr = bptr.Top; sptr != null; sptr = sptr.Down)
                {
                    sptr.AddEndIntersections(intptr, intCount);
                    if (prev != null && prev.IsSameSeg(sptr))
                    {
                        prev.AddLIntersection(sptr);
                        sptr.AddLIntersection(prev);
                    }
                    intptr = intptr.next;
                    prev   = sptr;
                }
            }

            for (Bundle bptr = newEqTree.Bottom; bptr != null; bptr = bptr.PurpleUp)
            {
                for (Segment sptr = bptr.Bottom; sptr != null; sptr = sptr.Up)
                {
                    sptr.AddStartIntersections(intptr, intCount);
                    intptr = intptr.next;
                }
            }
        }
Esempio n. 4
0
 public void AddLIntersection(Segment seg)
 {
     mid_int  = new SingleLL(seg, mid_int);
     midDegen = true;
 }
Esempio n. 5
0
 public void AddStartIntersections(SingleLL intList, int numint)
 {
     start_int = intList;
 }
Esempio n. 6
0
 public void AddEndIntersections(SingleLL intList, int numint)
 {
     end_int = intList;
 }
Esempio n. 7
0
 public void AddNonDegenerateIntersection(Segment seg)
 {
     mid_int  = new SingleLL(seg, mid_int);
     midDegen = false;
 }