예제 #1
0
        public Rectangles intersectingRects(Rectangle r)
        {
            Rectangles tmp = new Rectangles();

            foreach (Rectangle rInList in list)
            {
                if (rInList.Intersect(r))
                {
                    tmp.list.Add(rInList);//on bypass le test déjà fait a l'ajout intial du rect dans la liste
                }
            }
            return(tmp);
        }
예제 #2
0
        /// <summary>
        /// Return rectangles with size smaller than r.size
        /// </summary>
        public Rectangles SmallerRects(Rectangle r)
        {
            Rectangles tmp = new Rectangles();

            foreach (Rectangle rInList in list)
            {
                if (rInList.Size < r.Size)
                {
                    tmp.list.Add(rInList);
                }
            }

            return(tmp);
        }
예제 #3
0
        public Rectangles SmallerContainedRects(Rectangle r)
        {
            Rectangles tmp = new Rectangles();

            foreach (Rectangle rInList in list)
            {
                if (r.ContainsOrIsEqual(rInList) && rInList.Size < r.Size)
                {
                    tmp.list.Add(rInList);
                }
            }

            return(tmp);
        }
예제 #4
0
        public Rectangles containedOrEqualRects(Rectangle r)
        {
            Rectangles tmp = new Rectangles();

            foreach (Rectangle rInList in list)
            {
                if (r.ContainsOrIsEqual(rInList))                // && rInList.Size <= r.Size)
                {
                    tmp.list.Add(rInList);
                }
            }

            return(tmp);
        }