Beispiel #1
0
        public IShape2D GetGlyphShape(bool vertical, out WW.Math.Point2D endPoint)
        {
            IShape2D wrappedShape;

            if (vertical)
            {
                if (this.generalShape2D_1 == null)
                {
                    ShxShape.Class466 class466 = this.method_0(vertical);
                    this.generalShape2D_1 = class466.Shape;
                    this.point2D_1        = class466.CurrentPosition;
                }
                wrappedShape = (IShape2D)this.generalShape2D_1;
                endPoint     = this.point2D_1;
            }
            else
            {
                if (this.generalShape2D_0 == null)
                {
                    ShxShape.Class466 class466 = this.method_0(vertical);
                    this.generalShape2D_0 = class466.Shape;
                    this.point2D_0        = class466.CurrentPosition;
                }
                wrappedShape = (IShape2D)this.generalShape2D_0;
                endPoint     = this.point2D_0;
            }
            return((IShape2D) new CachedBoundsShape2D(wrappedShape));
        }
Beispiel #2
0
        public GraphicsPath GetGraphicsPath(bool vertical, out PointF endPoint)
        {
            GraphicsPath graphicsPath;

            if (vertical)
            {
                if (this.generalShape2D_1 == null)
                {
                    ShxShape.Class466 class466 = this.method_0(vertical);
                    this.generalShape2D_1 = class466.Shape;
                    this.point2D_1        = class466.CurrentPosition;
                }
                graphicsPath = (GraphicsPath)this.generalShape2D_1;
                endPoint     = (PointF)this.point2D_1;
            }
            else
            {
                if (this.generalShape2D_0 == null)
                {
                    ShxShape.Class466 class466 = this.method_0(vertical);
                    this.generalShape2D_0 = class466.Shape;
                    this.point2D_0        = class466.CurrentPosition;
                }
                graphicsPath = (GraphicsPath)this.generalShape2D_0;
                endPoint     = (PointF)this.point2D_0;
            }
            return(graphicsPath);
        }
Beispiel #3
0
 private static int smethod_14(ShxShape.Class466 plotter, byte[] geometry, int offset)
 {
     if (!plotter.Vertical)
     {
         plotter.IgnoreNextCommand = true;
     }
     return(1);
 }
Beispiel #4
0
 private static int smethod_8(ShxShape.Class466 plotter, byte[] geometry, int offset)
 {
     if (plotter.method_0())
     {
         plotter.method_7((double)(sbyte)geometry[offset + 1], (double)(sbyte)geometry[offset + 2]);
     }
     return(3);
 }
Beispiel #5
0
 private static int smethod_6(ShxShape.Class466 plotter, byte[] geometry, int offset)
 {
     if (plotter.method_0())
     {
         plotter.method_4();
     }
     return(1);
 }
Beispiel #6
0
 private static int smethod_2(ShxShape.Class466 plotter, byte[] geometry, int offset)
 {
     if (plotter.method_0())
     {
         plotter.PenDown = false;
     }
     return(1);
 }
Beispiel #7
0
        private static int smethod_7(ShxShape.Class466 plotter, byte[] geometry, int offset)
        {
            plotter.method_1();
            ShxFile shxFile = plotter.ShxFile;
            int     num1;

            if (shxFile.ShxFormat == ShxFormat.shxUnicode1_0)
            {
                char     ch           = Convert.ToChar(((int)geometry[offset + 1] << 8) + (int)geometry[offset + 2]);
                ShxShape shapeByIndex = shxFile.GetShapeByIndex((ushort)ch);
                if (shapeByIndex == null)
                {
                    throw new Exception("No shape found with id " + (object)ch + " in shx file " + shxFile.FileName + ".");
                }
                if (plotter.method_0())
                {
                    shapeByIndex.method_1(plotter);
                }
                num1 = 3;
            }
            else if (geometry[offset + 1] != (byte)0)
            {
                char     ch           = Convert.ToChar(geometry[offset + 1]);
                ShxShape shapeByIndex = shxFile.GetShapeByIndex((ushort)ch);
                if (shapeByIndex == null)
                {
                    throw new Exception("No shape found with id " + (object)ch + " in shx file " + shxFile.FileName + ".");
                }
                if (plotter.method_0())
                {
                    shapeByIndex.method_1(plotter);
                }
                num1 = 2;
            }
            else
            {
                ushort   index        = (ushort)((uint)geometry[offset + 2] << 8 | (uint)geometry[offset + 3]);
                ShxShape shapeByIndex = shxFile.GetShapeByIndex(index);
                if (shapeByIndex == null)
                {
                    throw new Exception("No shape found with id " + (object)index + " in shx file " + shxFile.FileName + ".");
                }
                if (plotter.method_0())
                {
                    ShxShape.Class466 class466       = shapeByIndex.method_0(false);
                    float             num2           = (float)geometry[offset + 4];
                    float             num3           = (float)geometry[offset + 5];
                    float             num4           = (float)geometry[offset + 6] / (float)shxFile.Width;
                    float             num5           = (float)geometry[offset + 7] / (float)shxFile.Height;
                    Matrix3D          transformation = new Matrix3D((double)num4, 0.0, (double)num2, 0.0, (double)num5, (double)num3, 0.0, 0.0, 1.0);
                    class466.Shape.TransformBy(transformation);
                    plotter.method_10((IShape2D)class466.Shape, false);
                }
                num1 = 8;
            }
            plotter.method_2();
            return(num1);
        }
Beispiel #8
0
 private static int smethod_12(ShxShape.Class466 plotter, byte[] geometry, int offset)
 {
     if (plotter.method_0())
     {
         float x     = (float)(sbyte)geometry[offset + 1];
         float y     = (float)(sbyte)geometry[offset + 2];
         float bulge = (float)(sbyte)geometry[offset + 3] / (float)sbyte.MaxValue;
         plotter.method_9(x, y, bulge);
     }
     return(4);
 }
Beispiel #9
0
        private static int smethod_9(ShxShape.Class466 plotter, byte[] geometry, int offset)
        {
            bool flag = plotter.method_0();
            int  index;

            for (index = offset + 1; geometry[index] != (byte)0 || geometry[index + 1] != (byte)0; index += 2)
            {
                if (flag)
                {
                    plotter.method_7((double)(sbyte)geometry[index], (double)(sbyte)geometry[index + 1]);
                }
            }
            return(index - offset + 2);
        }
Beispiel #10
0
 private static int smethod_10(ShxShape.Class466 plotter, byte[] geometry, int offset)
 {
     if (plotter.method_0())
     {
         int   num1 = (int)geometry[offset + 1];
         int   num2 = (int)geometry[offset + 2] >> 4 & 7;
         sbyte num3 = (sbyte)geometry[offset + 2];
         int   num4 = num3 < (sbyte)0 ? -((int)num3 & 7) : (int)num3 & 7;
         if (num4 == 0)
         {
             num4 = 8;
         }
         plotter.method_8((double)num1, (double)num2 * 0.785398185253143, (double)num4 * 0.785398185253143);
     }
     return(3);
 }
Beispiel #11
0
        private static int smethod_13(ShxShape.Class466 plotter, byte[] geometry, int offset)
        {
            bool flag = plotter.method_0();
            int  index;

            for (index = offset + 1; geometry[index] != (byte)0 || geometry[index + 1] != (byte)0; index += 3)
            {
                if (flag)
                {
                    float x     = (float)(sbyte)geometry[index];
                    float y     = (float)(sbyte)geometry[index + 1];
                    float bulge = (float)(sbyte)geometry[index + 2] / (float)sbyte.MaxValue;
                    plotter.method_9(x, y, bulge);
                }
            }
            return(index - offset + 2);
        }
Beispiel #12
0
 private static int smethod_11(ShxShape.Class466 plotter, byte[] geometry, int offset)
 {
     if (plotter.method_0())
     {
         float num1 = 0.003067962f * (float)geometry[offset + 1];
         float num2 = 0.003067962f * (float)geometry[offset + 2];
         int   num3 = ((int)geometry[offset + 3] << 8) + (int)geometry[offset + 4];
         int   num4 = (int)geometry[offset + 5] >> 4 & 7;
         sbyte num5 = (sbyte)geometry[offset + 5];
         int   num6 = num5 < (sbyte)0 ? -((int)num5 & 7) : (int)num5 & 7;
         float num7;
         float num8;
         if (num5 >= (sbyte)0)
         {
             num7 = 0.7853982f * (float)num4 + num1;
             num8 = (double)num2 == 0.0 ? (float)num6 * 0.7853982f - num1 : (float)(num6 - 1) * 0.7853982f - num1 + num2;
             if ((double)num8 < 0.0)
             {
                 num8 += 6.283185f;
             }
         }
         else
         {
             num7 = 0.7853982f * (float)num4 - num1;
             num8 = (double)num2 == 0.0 ? (float)num6 * 0.7853982f + num1 : (float)(num6 + 1) * 0.7853982f + num1 - num2;
             if ((double)num8 > 0.0)
             {
                 num8 -= 6.283185f;
             }
         }
         if ((double)num8 != 0.0)
         {
             plotter.method_8((double)num3, (double)num7, (double)num8);
         }
     }
     return(6);
 }
Beispiel #13
0
        private void method_1(ShxShape.Class466 plotter)
        {
            int offset = 0;

            while (offset < this.byte_0.Length)
            {
                byte num1 = this.byte_0[offset];
                if (num1 < (byte)16)
                {
                    ShxShape.Delegate9 delegate9 = ShxShape.delegate9_0[(int)num1];
                    offset += delegate9(plotter, this.byte_0, offset);
                }
                else
                {
                    float    num2     = (float)((int)num1 >> 4 & 15);
                    Vector2D vector2D = ShxShape.vector2D_0[(int)num1 & 15];
                    if (plotter.method_0())
                    {
                        plotter.method_7((double)num2 * vector2D.X, (double)num2 * vector2D.Y);
                    }
                    ++offset;
                }
            }
        }
Beispiel #14
0
 private static int smethod_15(ShxShape.Class466 plotter, byte[] geometry, int offset)
 {
     throw new Exception("Unknown shx shape command.");
 }
Beispiel #15
0
 private static int smethod_0(ShxShape.Class466 plotter, byte[] geometry, int offset)
 {
     return(1);
 }
Beispiel #16
0
 private ShxShape.Class466 method_0(bool vertical)
 {
     ShxShape.Class466 plotter = new ShxShape.Class466(this.shxFile_0, vertical);
     this.method_1(plotter);
     return(plotter);
 }