Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="action"></param>
        public virtual void ComputeOverlaps(ISweepLineOverlapAction action)
        {
            _nOverlaps = 0;
            BuildIndex();

            for (int i = 0; i < _events.Count; i++)
            {
                SweepLineEvent ev = (SweepLineEvent)_events[i];
                if (ev.IsInsert)
                    ProcessOverlaps(i, ev.DeleteEventIndex, ev.Interval, action);
            }
        }
Пример #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="action"></param>
        public void ComputeOverlaps(ISweepLineOverlapAction action)
        {
            _nOverlaps = 0;
            BuildIndex();

            for (int i = 0; i < _events.Count; i++)
            {
                SweepLineEvent ev = _events[i];
                if (ev.IsInsert)               
                    ProcessOverlaps(i, ev.DeleteEventIndex, ev.Interval, action);                
            }
        }
Пример #3
0
        }         // private void BuildIndex()

        /// <summary>
        ///
        /// </summary>
        /// <param name="action"></param>
        public void ComputeOverlaps(ISweepLineOverlapAction action)
        {
            _nOverlaps = 0;
            BuildIndex();

            for (int i = 0; i < _events.Count; i++)
            {
                SweepLineEvent    ev       = (SweepLineEvent)_events[i];
                SweepLineInterval sweepInt = ev.Interval;
                if (ev.IsInsert)
                {
                    ProcessOverlaps(i, ev.DeleteEventIndex, sweepInt, action);
                }
            }     // for ( int i = 0; i < _events.Count; i++ )
        }         // public void ComputeOverlaps( SweepLineOverlapAction action )
Пример #4
0
 /// <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++;
         }
     }
 }
Пример #5
0
 /// <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++;
         }
     }
 }
Пример #6
0
		} // private void BuildIndex()

		/// <summary>
		/// 
		/// </summary>
		/// <param name="action"></param>
		public void ComputeOverlaps( ISweepLineOverlapAction action )
		{
			_nOverlaps = 0;
			BuildIndex();

			for ( int i = 0; i < _events.Count; i++ )
			{
				SweepLineEvent ev = (SweepLineEvent) _events[i];
				SweepLineInterval sweepInt = ev.Interval;
				if ( ev.IsInsert ) 
				{
					ProcessOverlaps( i, ev.DeleteEventIndex, sweepInt, action );
				}

			} // for ( int i = 0; i < _events.Count; i++ )

		} // public void ComputeOverlaps( SweepLineOverlapAction action )