Intersects() 공개 메소드

Checks if this rectangle intersects with specified rectangle
public Intersects ( RectangleR2 r ) : bool
r RectangleR2
리턴 bool
예제 #1
0
파일: RtreeR2Page.cs 프로젝트: kjk/volante
 internal void find(RectangleR2 r, ArrayList result, int level)
 {
     if (--level != 0)
     { /* this is an internal node in the tree */
         for (int i = 0; i < n; i++)
         {
             if (r.Intersects(b[i]))
             {
                 ((RtreeR2Page)branch[i]).find(r, result, level);
             }
         }
     }
     else
     { /* this is a leaf node */
         for (int i = 0; i < n; i++)
         {
             if (r.Intersects(b[i]))
             {
                 result.Add(branch[i]);
             }
         }
     }
 }
예제 #2
0
파일: RtreeR2Page.cs 프로젝트: kjk/volante
 internal int remove(RectangleR2 r, IPersistent obj, int level, ArrayList reinsertList)
 {
     if (--level != 0)
     {
         for (int i = 0; i < n; i++)
         {
             if (r.Intersects(b[i]))
             {
                 RtreeR2Page pg = (RtreeR2Page)branch[i];
                 int reinsertLevel = pg.remove(r, obj, level, reinsertList);
                 if (reinsertLevel >= 0)
                 {
                     if (pg.n >= minFill)
                     {
                         setBranch(i, pg.cover(), pg);
                         Modify();
                     }
                     else
                     {
                         // not enough entries in child
                         reinsertList.Add(pg);
                         reinsertLevel = level - 1;
                         removeBranch(i);
                     }
                     return reinsertLevel;
                 }
             }
         }
     }
     else
     {
         for (int i = 0; i < n; i++)
         {
             if (branch.ContainsElement(i, obj))
             {
                 removeBranch(i);
                 return 0;
             }
         }
     }
     return -1;
 }