Example #1
0
        public void printRegion()
        {
            int minX = region.getCoord()[0];
            int maxX = region.getCoord()[1];
            int minY = region.getCoord()[2];
            int maxY = region.getCoord()[3];

            for (int y = minY; y <= maxY; y++)
            {
                for (int x = minX; x <= maxX; x++)
                {
                    Rectangle r             = new Rectangle(x, x, y, y);
                    bool      schonGedruckt = false;
                    foreach (Rectangle s in In)
                    {
                        if (Rectangle.subset(r, s) && !schonGedruckt)
                        {
                            schonGedruckt = true;
                            Console.Write("R");
                        }
                    }
                    if (!schonGedruckt)
                    {
                        Console.Write(" ");
                    }
                }
                Console.WriteLine();
            }
            ;
            Console.ReadKey();
        }
Example #2
0
 public void OrRectRegion(Rectangle newRectangle)
 {
     //1) Prüfe auf Kollisionen mit bisherigen Rectangles
     for (int c = In.Count() - 1; c >= 0; c--)
     {
         if (Rectangle.subset(In[c], newRectangle))
         {
             In.RemoveAt(c);
         }
     }
     this.CutOrIn(In, newRectangle, true);
     this.region.RegionRect(In);
 }