コード例 #1
0
ファイル: ShxShape.cs プロジェクト: 15831944/WW
        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);
        }
コード例 #2
0
ファイル: DxfShape.cs プロジェクト: 15831944/WW
        public override void DrawInternal(
            DrawContext.Surface context,
            Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock)
        {
            DxfTextStyle textStyle = this.TextStyle;

            if (textStyle == null)
            {
                return;
            }
            ShxFile shxFile = textStyle.GetShxFile();

            if (shxFile == null)
            {
                return;
            }
            ShxShape shapeByIndex = shxFile.GetShapeByIndex(this.ushort_0);

            if (shapeByIndex == null)
            {
                return;
            }
            ArgbColor plotColor = context.GetPlotColor((DxfEntity)this);

            if (!graphics.AddExistingGraphicElement1(parentGraphicElementBlock, (DxfEntity)this, plotColor))
            {
                return;
            }
            WW.Math.Point2D endPoint;
            new Class355((DxfEntity)this, context, graphics, parentGraphicElementBlock).DrawPath(shapeByIndex.GetGlyphShape(false, out endPoint), this.Transform, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this), false, false, this.double_1);
        }
コード例 #3
0
ファイル: DxfShape.cs プロジェクト: 15831944/WW
        public override void DrawInternal(
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory)
        {
            DxfTextStyle textStyle = this.TextStyle;

            if (textStyle == null)
            {
                return;
            }
            ShxFile shxFile = textStyle.GetShxFile();

            if (shxFile == null)
            {
                return;
            }
            ShxShape shapeByIndex = shxFile.GetShapeByIndex(this.ushort_0);

            if (shapeByIndex == null)
            {
                return;
            }
            WW.Math.Point2D endPoint;
            new Class473((DxfEntity)this, context, graphicsFactory).DrawPath(shapeByIndex.GetGlyphShape(false, out endPoint), this.Transform, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this), false, false, this.double_1);
        }
コード例 #4
0
ファイル: DxfShape.cs プロジェクト: 15831944/WW
 private void method_13(ShxFile shxFile)
 {
     if (shxFile != null)
     {
         ShxShape shapeByIndex = shxFile.GetShapeByIndex(this.ushort_0);
         if (shapeByIndex != null)
         {
             this.string_0 = shapeByIndex.Description;
         }
         else
         {
             this.string_0 = string.Empty;
         }
     }
     else
     {
         this.string_0 = string.Empty;
     }
 }