Ejemplo n.º 1
0
 public override Extents GetExtents()
 {
     Extents extents = new Extents();
     extents.Add(X1, Y1);
     extents.Add(X2, Y2);
     return extents;
 }
Ejemplo n.º 2
0
 public override Extents GetExtents()
 {
     Extents extents = new Extents();
     foreach (Point2D point in Points)
     {
         extents.Add(point.X, point.Y);
     }
     return extents;
 }
Ejemplo n.º 3
0
 public void Add(Extents extents)
 {
     Add(extents.XMin, extents.YMin);
     Add(extents.XMax, extents.YMax);
 }
Ejemplo n.º 4
0
        public override Extents GetExtents()
        {
            float thHeight = Height * Lines.Length * 1.425f;
            float thWidth = 0;
            foreach (string line in Lines)
            {
                thWidth = Math.Max(thWidth, line.Length * Height / 2);
            }

            float angle = Rotation / 180 * (float)Math.PI;
            Point2D p1 = new Point2D(0, 0);
            Point2D p2 = new Point2D(thWidth, 0);
            Point2D p3 = new Point2D(0, -thHeight);
            Point2D p4 = new Point2D(thWidth, -thHeight);
            Matrix2D trans = Matrix2D.Transformation(1, 1, angle, P.X, P.Y);
            p1.TransformBy(trans);
            p2.TransformBy(trans);
            p3.TransformBy(trans);
            p4.TransformBy(trans);

            Extents extents = new Extents();
            extents.Add(p1);
            extents.Add(p2);
            extents.Add(p3);
            extents.Add(p4);
            return extents;
        }
Ejemplo n.º 5
0
        public override Extents GetExtents()
        {
            float offset = Math.Sign(Offset) * (0.5f * TextHeight + Math.Abs(Offset));

            Vector2D dir = P2 - P1;
            float angle = dir.Angle;
            float len = dir.Length;
            Point2D p1 = new Point2D(0, 0);
            Point2D p2 = new Point2D(len, 0);
            Point2D p3 = p1 + new Vector2D(0, offset);
            Point2D p4 = p2 + new Vector2D(0, offset);
            Matrix2D trans = Matrix2D.Transformation(1, 1, angle, P1.X, P1.Y);
            p1.TransformBy(trans);
            p2.TransformBy(trans);
            p3.TransformBy(trans);
            p4.TransformBy(trans);

            Extents extents = new Extents();
            extents.Add(p1);
            extents.Add(p2);
            extents.Add(p3);
            extents.Add(p4);
            return extents;
        }
Ejemplo n.º 6
0
 public void Add(Extents extents)
 {
     Add(extents.XMin, extents.YMin);
     Add(extents.XMax, extents.YMax);
 }
Ejemplo n.º 7
0
        public override Extents GetExtents()
        {
            float angle = Rotation / 180 * (float)Math.PI;
            float thHeight = Height;
            float thWidth = String.Length * thHeight / 2;
            Point2D p1 = new Point2D(0, 0);
            Point2D p2 = new Point2D(thWidth, 0);
            Point2D p3 = new Point2D(0, thHeight);
            Point2D p4 = new Point2D(thWidth, thHeight);
            float dx = 0;
            float dy = 0;
            if (HorizontalAlignment == StringAlignment.Far)
                dx = -thWidth;
            else if (HorizontalAlignment == StringAlignment.Center)
                dx = -thWidth / 2;
            if (VerticalAlignment == StringAlignment.Far)
                dy = -thHeight;
            else if (VerticalAlignment == StringAlignment.Center)
                dy = -thHeight / 2;
            Vector2D offset = new Vector2D(dx, dy);
            p1 = p1 + offset;
            p2 = p2 + offset;
            p3 = p3 + offset;
            p4 = p4 + offset;
            Matrix2D trans = Matrix2D.Transformation(1, 1, angle, P.X, P.Y);
            p1.TransformBy(trans);
            p2.TransformBy(trans);
            p3.TransformBy(trans);
            p4.TransformBy(trans);

            Extents extents = new Extents();
            extents.Add(p1);
            extents.Add(p2);
            extents.Add(p3);
            extents.Add(p4);
            return extents;
        }
Ejemplo n.º 8
0
 public Extents GetExtents()
 {
     Extents extents = new Extents();
     foreach (Drawable item in Model)
     {
         extents.Add(item.GetExtents());
     }
     return extents;
 }