Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="edge"></param>
        /// <param name="edgeSet"></param>
        private void Add(Edge edge, object edgeSet)
        {
            IList <Coordinate> pts = edge.Coordinates;

            for (int i = 0; i < pts.Count - 1; i++)
            {
                SweepLineSegment ss          = new SweepLineSegment(edge, i);
                SweepLineEvent   insertEvent = new SweepLineEvent(edgeSet, ss.MinX, null, ss);
                _events.Add(insertEvent);
                _events.Add(new SweepLineEvent(edgeSet, ss.MaxX, insertEvent, ss));
            }
        }
Esempio n. 2
0
        /// <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)
        {
            SweepLineSegment ss0 = (SweepLineSegment)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 = (SweepLineEvent)_events[i];
                if (ev1.IsInsert)
                {
                    SweepLineSegment ss1 = (SweepLineSegment)ev1.Object;
                    if (ev0.EdgeSet == null || (ev0.EdgeSet != ev1.EdgeSet))
                    {
                        ss0.ComputeIntersections(ss1, si);
                    }
                    _nOverlaps++;
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ss"></param>
 /// <param name="si"></param>
 public virtual void ComputeIntersections(SweepLineSegment ss, SegmentIntersector si)
 {
     si.AddIntersections(_edge, _ptIndex, ss._edge, ss._ptIndex);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="edge"></param>
 /// <param name="edgeSet"></param>
 private void Add(Edge edge, object edgeSet)
 {
     IList<Coordinate> pts = edge.Coordinates;
     for (int i = 0; i < pts.Count - 1; i++)
     {
         SweepLineSegment ss = new SweepLineSegment(edge, i);
         SweepLineEvent insertEvent = new SweepLineEvent(edgeSet, ss.MinX, null, ss);
         _events.Add(insertEvent);
         _events.Add(new SweepLineEvent(edgeSet, ss.MaxX, insertEvent, ss));
     }
 }
Esempio n. 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ss"></param>
 /// <param name="si"></param>
 public virtual void ComputeIntersections(SweepLineSegment ss, SegmentIntersector si)
 {
     si.AddIntersections(_edge, _ptIndex, ss._edge, ss._ptIndex);
 }