Exemple #1
0
        public List <T> QueryBounds(Bounds bounds, bool EdgeTouchIsIntersection)
        {
            List <T> results = new List <T>();

            if (!Bounds.IntersectsWith(bounds, EdgeTouchIsIntersection))
            {
                return(results); // return empty list
            }
            // else check our members
            foreach (BoundsLink <T> member in Members)
            {
                if (member.bounds.IntersectsWith(bounds, EdgeTouchIsIntersection))
                {
                    results.Add(member.link);
                }
            }
            // check our leaves as well
            if (IsDivided)
            {
                results.AddRange(NW.QueryBounds(bounds, EdgeTouchIsIntersection));
                results.AddRange(NE.QueryBounds(bounds, EdgeTouchIsIntersection));
                results.AddRange(SW.QueryBounds(bounds, EdgeTouchIsIntersection));
                results.AddRange(SE.QueryBounds(bounds, EdgeTouchIsIntersection));
            }
            // return the compounded list
            return(results);
        }