コード例 #1
0
ファイル: SweepLineEvent.cs プロジェクト: klosejay/Gisoft.Map
 /// <summary>
 ///
 /// </summary>
 /// <param name="x"></param>
 /// <param name="insertEvent"></param>
 /// <param name="sweepInt"></param>
 public SweepLineEvent(double x, SweepLineEvent insertEvent, SweepLineInterval sweepInt)
 {
     xValue           = x;
     this.insertEvent = insertEvent;
     if (insertEvent != null)
     {
         eventType = SweepLineEvents.Delete;
     }
     else
     {
         eventType = SweepLineEvents.Insert;
     }
     this.sweepInt = sweepInt;
 }
コード例 #2
0
ファイル: SweepLineIndex.cs プロジェクト: klosejay/Gisoft.Map
 /// <summary>
 /// 
 /// </summary>
 /// <param name="start"></param>
 /// <param name="end"></param>
 /// <param name="s0"></param>
 /// <param name="action"></param>
 private void ProcessOverlaps(int start, int end, SweepLineInterval s0, ISweepLineOverlapAction action)
 {
     /*
      * 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 ev = _events[i];
         if (ev.IsInsert)
         {
             SweepLineInterval s1 = ev.Interval;
             action.Overlap(s0, s1);
             _nOverlaps++;
         }
     }
 }
コード例 #3
0
ファイル: SweepLineIndex.cs プロジェクト: klosejay/Gisoft.Map
 /*
 /// <summary>
 /// 
 /// </summary>
 public SweepLineIndex() { }
 */
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sweepInt"></param>
 public void Add(SweepLineInterval sweepInt)
 {
     SweepLineEvent insertEvent = new SweepLineEvent(sweepInt.Min, null, sweepInt);
     _events.Add(insertEvent);
     _events.Add(new SweepLineEvent(sweepInt.Max, insertEvent, sweepInt));
 }