/// <summary> /// /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <param name="ev0"></param> /// <param name="si"></param> private void ProcessOverlaps(int start, int end, SweepLineEvent ev0, SegmentIntersector si) { MonotoneChain mc0 = (MonotoneChain)ev0.Object; /* * Since we might need to test for self-intersections, * include current insert event object in list of event objects to test. * Last index can be skipped, because it must be a Delete event. */ for (int i = start; i < end; i++) { SweepLineEvent ev1 = _events[i]; if (ev1.IsInsert) { MonotoneChain mc1 = (MonotoneChain)ev1.Object; // don't compare edges in same group // null group indicates that edges should be compared if (ev0.EdgeSet == null || (ev0.EdgeSet != ev1.EdgeSet)) { mc0.ComputeIntersections(mc1, si); _nOverlaps++; } } } }
/// <summary> /// /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <param name="ev0"></param> /// <param name="si"></param> private void ProcessOverlaps(int start, int end, SweepLineEvent ev0, SegmentIntersector si) { MonotoneChain mc0 = (MonotoneChain)ev0.Object; /* * Since we might need to test for self-intersections, * include current INSERT event object in list of event objects to test. * Last index can be skipped, because it must be a Delete event. */ for (int i = start; i < end; i++) { SweepLineEvent ev1 = _events[i]; if (ev1.IsInsert) { MonotoneChain mc1 = (MonotoneChain)ev1.Object; // don't compare edges in same group, if labels are present if (!ev0.IsSameLabel(ev1)) { mc0.ComputeIntersections(mc1, si); _nOverlaps++; } } } }