Ejemplo n.º 1
0
        public List <T> IntersectsWith(Rect queryArea)
        {
            List <T> objList = new List <T>();

            using (List <T> .Enumerator enumerator = this.m_Elements.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    T current = enumerator.Current;
                    if (RectUtils.Intersects(current.boundingRect, queryArea))
                    {
                        objList.Add(current);
                    }
                }
            }
            using (List <QuadTreeNode <T> > .Enumerator enumerator = this.m_ChildrenNodes.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    QuadTreeNode <T> current = enumerator.Current;
                    if (!current.IsEmpty && RectUtils.Intersects(current.BoundingRect, queryArea))
                    {
                        objList.AddRange((IEnumerable <T>)current.IntersectsWith(queryArea));
                        break;
                    }
                }
            }
            return(objList);
        }
Ejemplo n.º 2
0
 public List <T> IntersectsWith(Rect area)
 {
     return(m_Root.IntersectsWith(area));
 }