示例#1
0
文件: DxfMText.cs 项目: 15831944/WW
 public override void DrawInternal(
     DrawContext.Wireframe context,
     IWireframeGraphicsFactory2 graphicsFactory)
 {
     if (context.Config.TryDrawingTextAsText && graphicsFactory.SupportsText)
     {
         graphicsFactory.BeginGeometry((DxfEntity)this, context, context.GetPlotColor((DxfEntity)this), true, true, false, true);
         graphicsFactory.CreateMText(this);
         graphicsFactory.EndGeometry();
     }
     else
     {
         this.method_16((DrawContext)context, (IPathDrawer) new Class396((DxfEntity)this, context, graphicsFactory));
         if (!context.Config.ShowTextAlignmentPoints)
         {
             return;
         }
         IList <Polyline4D> polylines = DxfUtil.smethod_36(this.method_18(), false, context.GetTransformer());
         if (polylines.Count <= 0)
         {
             return;
         }
         Class940.smethod_3((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this), true, false, true, polylines);
     }
 }
示例#2
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            IList <Polyline4D>  polylines4D;
            IList <FlatShape4D> shapes;
            bool fill;

            this.GetPolylines4D((DrawContext)context, context.GetTransformer(), out polylines4D, out shapes, out fill);
            ArgbColor plotColor = context.GetPlotColor((DxfEntity)this);

            if (polylines4D.Count > 0)
            {
                Class940.smethod_3((DxfEntity)this, context, graphicsFactory, plotColor, false, fill, !fill, polylines4D);
            }
            if (shapes == null)
            {
                return;
            }
            IPathDrawer pathDrawer = (IPathDrawer) new Class396((DxfEntity)this, context, graphicsFactory);

            foreach (FlatShape4D flatShape4D in (IEnumerable <FlatShape4D>)shapes)
            {
                pathDrawer.DrawPath(flatShape4D.FlatShape, flatShape4D.Transformation, this.Color.ToColor(), (short)0, flatShape4D.IsFilled, false, this.Thickness);
            }
        }
示例#3
0
        public void DrawPath(
            IShape2D path,
            Matrix4D transform,
            Color color,
            short lineWeight,
            bool filled,
            bool forText,
            double extrusion)
        {
            if (!path.HasSegments)
            {
                return;
            }
            IClippingTransformer transformer = (IClippingTransformer)this.wireframe_0.GetTransformer().Clone();

            transformer.SetPreTransform(transform);
            if (extrusion == 0.0)
            {
                IShape4D shape1 = (IShape4D) new FlatShape4D(path, filled);
                IShape4D shape2 = transformer.Transform(shape1);
                if (shape2.IsEmpty)
                {
                    return;
                }
                this.iwireframeGraphicsFactory2_0.BeginGeometry(this.dxfEntity_0, this.wireframe_0, this.wireframe_0.GetPlotColor(this.dxfEntity_0, color), false, filled, !filled, true);
                this.iwireframeGraphicsFactory2_0.CreateShape(this.dxfEntity_0, shape2);
                this.iwireframeGraphicsFactory2_0.EndGeometry();
            }
            else
            {
                IList <Polyline2D> flattened  = (IList <Polyline2D>)ShapeTool.GetFlattened(path, this.wireframe_0.Config.ShapeFlattenEpsilon);
                IList <Polyline4D> polylines1 = DxfUtil.smethod_39(flattened, filled, transformer);
                ArgbColor          plotColor  = this.wireframe_0.GetPlotColor(this.dxfEntity_0, color);
                Class940.smethod_3(this.dxfEntity_0, this.wireframe_0, this.iwireframeGraphicsFactory2_0, plotColor, forText, false, true, polylines1);
                transformer.SetPreTransform(Transformation4D.Translation(0.0, 0.0, extrusion));
                IList <Polyline4D> polylines2 = DxfUtil.smethod_39(flattened, filled, transformer);
                Class940.smethod_3(this.dxfEntity_0, this.wireframe_0, this.iwireframeGraphicsFactory2_0, plotColor, forText, false, true, polylines2);
                Polyline4D polyline4D1 = new Polyline4D(2);
                polyline4D1.Add(Vector4D.Zero);
                polyline4D1.Add(Vector4D.Zero);
                IList <Polyline4D> polylines3 = (IList <Polyline4D>) new List <Polyline4D>(1);
                polylines3.Add(polyline4D1);
                for (int index1 = polylines1.Count - 1; index1 >= 0; --index1)
                {
                    Polyline4D polyline4D2 = polylines1[index1];
                    Polyline4D polyline4D3 = polylines2[index1];
                    for (int index2 = polyline4D2.Count - 1; index2 >= 0; --index2)
                    {
                        polyline4D1[0] = polyline4D2[index2];
                        polyline4D1[1] = polyline4D3[index2];
                        Class940.smethod_2(this.dxfEntity_0, this.wireframe_0, this.iwireframeGraphicsFactory2_0, plotColor, forText, false, true, polylines3);
                    }
                }
            }
        }
示例#4
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            IList <Polyline4D> polylines4D = this.GetPolylines4D(context.GetTransformer());

            if (polylines4D.Count <= 0)
            {
                return;
            }
            Class940.smethod_3((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this), false, false, true, polylines4D);
        }
示例#5
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            IList <Polyline4D> polylines4D = this.GetPolylines4D(context.GetTransformer());

            if (polylines4D.Count <= 0)
            {
                return;
            }
            bool fill = context.Model.Header.FillMode && this.vector3D_0.X == 0.0 && this.vector3D_0.Y == 0.0;

            Class940.smethod_3((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this), false, fill, !fill, polylines4D);
        }
示例#6
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            IList <Polyline4D> polylines4D;
            IList <IShape4D>   shapes;

            this.GetPolylines4D((DrawContext)context, context.GetTransformer(), out polylines4D, out shapes);
            if (polylines4D.Count > 0)
            {
                Class940.smethod_3((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this), false, false, true, polylines4D);
            }
            if (shapes == null)
            {
                return;
            }
            Class940.smethod_23((IPathDrawer) new Class396((DxfEntity)this, context, graphicsFactory), (IEnumerable <IShape4D>)shapes, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this));
        }
示例#7
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            IList <Polyline3D>  polylines1;
            IList <FlatShape4D> shapes;

            this.method_14((DrawContext)context, context.GetTransformer().LineTypeScaler, out polylines1, out shapes);
            IList <Polyline4D> polylines2 = DxfUtil.smethod_36(polylines1, false, context.GetTransformer());

            if (polylines2.Count > 0)
            {
                Class940.smethod_3((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this, this.dxfDimensionStyleOverrides_0.DimensionLineColor), false, false, true, polylines2);
            }
            if (shapes != null)
            {
                Class940.smethod_23((IPathDrawer) new Class396((DxfEntity)this, context, graphicsFactory), (IEnumerable <IShape4D>)shapes, this.dxfDimensionStyleOverrides_0.DimensionLineColor, context.GetLineWeight((DxfEntity)this));
            }
            if (!DxfLeader.smethod_7((ILeader)this, (IList <WW.Math.Point3D>) this.list_0))
            {
                return;
            }
            if (this.dxfDimensionStyleOverrides_0.LeaderArrowBlock == null)
            {
                Polyline3D polyline1 = this.method_15();
                if (polyline1 == null)
                {
                    return;
                }
                IClippingTransformer clippingTransformer = (IClippingTransformer)context.GetTransformer().Clone();
                clippingTransformer.SetPreTransform(this.method_16());
                foreach (Polyline4D polyline2 in new List <Polyline4D>((IEnumerable <Polyline4D>)clippingTransformer.Transform(polyline1, polyline1.Closed)))
                {
                    Class940.smethod_1((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this, this.dxfDimensionStyleOverrides_0.DimensionLineColor), false, true, false, polyline2);
                }
            }
            else
            {
                DxfInsert.Interface46 nterface46 = (DxfInsert.Interface46) new DxfInsert.Class1020((DxfEntity)this, context, graphicsFactory);
                nterface46.imethod_0(0, 0, this.method_16());
                nterface46.Draw(this.dxfDimensionStyleOverrides_0.LeaderArrowBlock, true);
            }
        }
示例#8
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            IClippingTransformer transformer = context.GetTransformer();
            IList <WW.Math.Geometry.Polyline3D> polylines1;
            IList <FlatShape4D> flatShapes;

            this.method_13((DrawContext)context, transformer, out polylines1, out flatShapes);
            IList <Polyline4D> polylines2 = DxfUtil.smethod_36(polylines1, false, transformer);

            if (polylines2.Count > 0)
            {
                Class940.smethod_3((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this), false, false, true, polylines2);
            }
            if (flatShapes == null)
            {
                return;
            }
            Class940.smethod_23((IPathDrawer) new Class396((DxfEntity)this, context, graphicsFactory), (IEnumerable <IShape4D>)flatShapes, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this));
        }
示例#9
0
文件: DxfOle.cs 项目: 15831944/WW
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            IList <Polyline4D> polyline4DList = context.GetTransformer().Transform(this.method_14(), true);

            if (polyline4DList == null || polyline4DList.Count <= 0)
            {
                return;
            }
            IList <Polyline4D> polylines4D;
            IList <IShape4D>   shapes;

            this.GetPolylines4D((DrawContext)context, context.GetTransformer(), out polylines4D, out shapes);
            Bitmap bitmap = this.Preview(context.Config.OleImageSize, context.Config.OleImageSize);

            if (bitmap != null)
            {
                DxfRasterImage rasterImage;
                Vector4D       transformedOrigin;
                Vector4D       transformedXAxis;
                Vector4D       transformedYAxis;
                this.method_15(context, bitmap, out rasterImage, out transformedOrigin, out transformedXAxis, out transformedYAxis);
                graphicsFactory.BeginGeometry((DxfEntity)this, context, context.GetPlotColor((DxfEntity)this), false, false, true, true);
                graphicsFactory.CreateImage(rasterImage, new WW.Math.Point2D(0.0, 0.0), new WW.Math.Point2D((double)(bitmap.Width - 1), (double)(bitmap.Height - 1)), transformedOrigin, transformedXAxis, transformedYAxis, context);
                graphicsFactory.EndGeometry();
            }
            if (polylines4D.Count > 0)
            {
                Class940.smethod_3((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this), false, false, true, polylines4D);
            }
            if (shapes == null)
            {
                return;
            }
            Class940.smethod_23((IPathDrawer) new Class396((DxfEntity)this, context, graphicsFactory), (IEnumerable <IShape4D>)shapes, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this));
        }
示例#10
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            if (this.list_0.Count == 0)
            {
                return;
            }
            DxfLayer      layer           = this.GetLayer((DrawContext)context);
            int           minElementCount = this.method_15();
            DxfMLineStyle style           = this.Style;

            for (int elementIndex = 0; elementIndex < style.Elements.Count; ++elementIndex)
            {
                DxfMLineStyle.Element element = style.Elements[elementIndex];
                IList <Polyline4D>    polylines4D;
                IList <IShape4D>      shapes;
                this.GetPolylines4D((DrawContext)context, elementIndex, minElementCount, element, context.GetTransformer(), out polylines4D, out shapes);
                ArgbColor color = DxfEntity.GetColor(context.Config.IndexedColors, element.Color, context.ByBlockColor, context.ByBlockDxfColor, layer);
                if (polylines4D.Count > 0)
                {
                    foreach (Polyline4D polyline4D in (IEnumerable <Polyline4D>)polylines4D)
                    {
                        if (polyline4D.Count <= 2)
                        {
                            polyline4D.Closed = false;
                        }
                    }
                    Class940.smethod_3((DxfEntity)this, context, graphicsFactory, color, false, false, true, polylines4D);
                }
                if (shapes != null)
                {
                    Class940.smethod_23((IPathDrawer) new Class396((DxfEntity)this, context, graphicsFactory), (IEnumerable <IShape4D>)shapes, element.Color, context.GetLineWeight((DxfEntity)this));
                }
            }
            IList <Polyline4D> polylines1 = this.method_14((DrawContext)context, context.GetTransformer());

            if (polylines1.Count > 0)
            {
                foreach (Polyline4D polyline4D in (IEnumerable <Polyline4D>)polylines1)
                {
                    if (polyline4D.Count <= 2)
                    {
                        polyline4D.Closed = false;
                    }
                }
                ArgbColor color = this.method_13((DrawContext)context, layer);
                Class940.smethod_3((DxfEntity)this, context, graphicsFactory, color, false, false, true, polylines1);
            }
            if (!style.IsFillOn)
            {
                return;
            }
            IList <Polyline4D> polylines2 = this.method_16(context.GetTransformer());

            if (polylines2 == null || polylines2.Count <= 0)
            {
                return;
            }
            Class940.smethod_2((DxfEntity)this, context, graphicsFactory, DxfEntity.GetColor(context.Config.IndexedColors, style.FillColor, context.ByBlockColor, context.ByBlockDxfColor, this.GetLayer((DrawContext)context)), false, true, false, polylines2);
        }