public IVisio.Shape DrawRectangle(Rectangle rect)
 {
     var shape = this.DrawRectangle(rect.Left, rect.Bottom, rect.Right, rect.Top);
     return shape;
 }
        public Rectangle GetBoundingBox(IVisio.VisBoundingBoxArgs args)
        {
            double bbx0, bby0, bbx1, bby1;
            if (this.Target.Master != null)
            {
                this.Target.Master.BoundingBox((short)args, out bbx0, out bby0, out bbx1, out bby1);
            }
            else if (this.Target.Page != null)
            {
                this.Target.Page.BoundingBox((short)args, out bbx0, out bby0, out bbx1, out bby1);
            }
            else if (this.Target.Shape != null)
            {
                this.Target.Shape.BoundingBox((short)args, out bbx0, out bby0, out bbx1, out bby1);
            }
            else
            {
                throw new System.ArgumentException("Unhandled Drawing Surface");
            }

            var r = new Rectangle(bbx0, bby0, bbx1, bby1);
            return r;
        }
        public IVisio.Shape DrawOval(Rectangle rect)
        {
            if (this.Target.Master != null)
            {
                var shape = this.Target.Master.DrawOval(rect.Left, rect.Bottom, rect.Right, rect.Top);
                return shape;
            }
            else if (this.Target.Page != null)
            {
                var shape = this.Target.Page.DrawOval(rect.Left, rect.Bottom, rect.Right, rect.Top);
                return shape;
            }
            else if (this.Target.Shape != null)
            {
                var shape = this.Target.Shape.DrawOval(rect.Left, rect.Bottom, rect.Right, rect.Top);
                return shape;
            }

            throw new System.ArgumentException("Unhandled Drawing Surface");
        }
        public IVisio.Shape DrawOval(Point center, double radius)
        {
            var A = center.Add(-radius, -radius);
            var B = center.Add(radius, radius);
            var rect = new Rectangle(A, B);

            return this.DrawOval(rect);
        }
 public Rectangle Subtract(Point s)
 {
     var r2 = new Rectangle(Left - s.X, Bottom - s.Y, Right - s.X, Top - s.Y);
     return r2;
 }
Example #6
0
 public static void AreEqual(double left, double bottom, double right, double top, VADRAW.Rectangle actual_rect, double delta)
 {
     Assert.AreEqual(left, actual_rect.Left, delta);
     Assert.AreEqual(bottom, actual_rect.Bottom, delta);
     Assert.AreEqual(right, actual_rect.Right, delta);
     Assert.AreEqual(top, actual_rect.Top, delta);
 }
 public Rectangle Subtract(double dx, double dy)
 {
     var r2 = new Rectangle(Left - dx, Bottom - dy, Right - dx, Top - dy);
     return r2;
 }
 public Rectangle Subtract(Size s)
 {
     var r2 = new Rectangle(Left - s.Width, Bottom - s.Height, Right - s.Width, Top - s.Height);
     return r2;
 }
 public Rectangle Add(Point s)
 {
     var r2 = new Rectangle(Left + s.X, Bottom + s.Y, Right + s.X, Top + s.Y);
     return r2;
 }
Example #10
0
 public Rectangle Multiply(double sx, double sy)
 {
     var r2 = new Rectangle(Left*sx, Bottom*sy, Right*sx, Top*sy);
     return r2;
 }
Example #11
0
 public Rectangle Add(Size s)
 {
     var r2 = new Rectangle(Left + s.Width, Bottom + s.Height, Right + s.Width, Top + s.Height);
     return r2;
 }
Example #12
0
 public Rectangle Add(double dx, double dy)
 {
     var r2 = new Rectangle(Left + dx, Bottom + dy, Right + dx, Top + dy);
     return r2;
 }
Example #13
0
        public static Rectangle FromCenterPoint(double x, double y, double w, double h)
        {
            if (w < 0)
            {
                throw new System.ArgumentOutOfRangeException("w", "width must be non-negative");
            }

            if (h < 0)
            {
                throw new System.ArgumentOutOfRangeException("h", "height must be non-negative");
            }

            var xradius = w/2.0;
            var yradius = h/2.0;
            var r = new Rectangle(x - xradius, y - yradius, x + xradius, y + yradius);
            return r;
        }
 public void Add(Rectangle r)
 {
     this.Add(r.LowerLeft);
     this.Add(r.UpperRight);
 }
Example #15
0
 public static void AreEqual(double left, double bottom, double right, double top, VADRAW.Rectangle r, double delta)
 {
     Assert.AreEqual(left, r.Left, delta);
     Assert.AreEqual(bottom, r.Bottom, delta);
     Assert.AreEqual(right, r.Right, delta);
     Assert.AreEqual(top, r.Top, delta);
 }