Example #1
0
 public bool IsCanContain(Rectangle rectangle)
 {
     bool is_checked = true;
     for (int j = 1; j <= this.vector.Dim && is_checked; j++)
         is_checked = rectangle.Vector[j] <= this.vector[j];
     return is_checked;
 }
Example #2
0
        public bool IsContain(Rectangle rectangle, Point2d pole)
        {
            Point2d pole_temp = rectangle.Pole;
            rectangle.Pole = pole;
            bool is_checked = true;
            for (int j = 1; j <= this.vector.Dim && is_checked; j++)
            {
                double coor = rectangle.Pole[j] + rectangle.Vector[j];
                is_checked = 0 <= coor && coor <= this.vector[j];
            }
            rectangle.Pole = pole_temp;

            return is_checked;
        }
Example #3
0
 public void Draw(System.Drawing.Graphics graphics, int Width, int Height, System.Drawing.Pen pen_region, System.Drawing.Brush brush_region, System.Drawing.Pen pen_objects, System.Drawing.Brush brush_objects, System.Drawing.Brush brush_text)
 {
     System.Drawing.Font my_font = new System.Drawing.Font("Arial", 6);
     graphics.FillRectangle(brush_region, 0, 0, (float)Math.Min(Width, region_size.X), (float)Math.Min(Height, region_size.Y));
     graphics.DrawRectangle(pen_region, 0, 0, (float)Math.Min(Width, task.RegionWidth), (float)Math.Min(Height, task.RegionHeight));
     for (int i = 0; i < objects_busy_numbers.Count; i++)
     {
         Rectangle rect = new Rectangle { Pole = objects_busy_points[i].Copy, Vector = objects_sizes[objects_busy_numbers[i]].Copy };
         graphics.FillRectangle(brush_objects, (float)rect.Pole.X, (float)rect.Pole.Y, (float)(rect.Pole.X + rect.Vector.X), (float)(rect.Pole.X + rect.Vector.Y));
         graphics.DrawRectangle(pen_objects, (float)rect.Pole.X, (float)rect.Pole.Y, (float)(rect.Pole.X + rect.Vector.X), (float)(rect.Pole.X + rect.Vector.Y));
         graphics.DrawString(i.ToString(), my_font, brush_text, new System.Drawing.RectangleF((float)rect.Pole.X, (float)rect.Pole.Y, (float)(rect.Vector.X), (float)(rect.Vector.Y)));
     }
 }
Example #4
0
 public static void FillAndDraw(this Graphics graphics, Brush brush, Pen pen, Geometric2dWithPointVector rectangle)
 {
     graphics.FillRectangle(brush, rectangle.ToRectangleF());
     graphics.DrawRectangle(pen, rectangle.ToRectangle());
 }