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); }
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); }
private static int smethod_6(ShxShape.Class466 plotter, byte[] geometry, int offset) { if (plotter.method_0()) { plotter.method_4(); } return(1); }
private static int smethod_2(ShxShape.Class466 plotter, byte[] geometry, int offset) { if (plotter.method_0()) { plotter.PenDown = false; } return(1); }
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); }
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); }
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); }
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); }
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); }
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; } } }