Esempio n. 1
0
        internal static TinyQueue divideSegment(SweepEvent se, Point p, TinyQueue queue)
        {
            var r = new SweepEvent(p, false, se, se.isSubject);
            var l = new SweepEvent(p, true, se.otherEvent, se.isSubject);

            if (equals(se.point, se.otherEvent.point))
            {
                MessageBox.Show("what is that?" + se.ToString());
            }

            r.contourId = l.contourId = se.contourId;

            // avoid a rounding error. The left _event would be processed after the right _event
            if (compareEvents(l, se.otherEvent) > 0)
            {
                se.otherEvent.left = true;
                l.left             = false;
            }

            // avoid a rounding error. The left _event would be processed after the right _event
            // if (compareEvents(se, r) > 0) {}

            se.otherEvent.otherEvent = l;
            se.otherEvent            = r;

            queue.push(l);
            queue.push(r);

            return(queue);
        }