Beispiel #1
0
 public void CreateText(DxfText text, DrawContext.Wireframe drawContext, ArgbColor color)
 {
     if (text.Text == null || text.Text.Trim() == string.Empty)
     {
         return;
     }
     this.method_3(Class666.smethod_5(text, text.Color.ToColor(), drawContext.GetLineWeight((DxfEntity)text), drawContext.GetTransformer().Matrix *text.Transform, (Bounds2D)null), (DxfEntity)text, drawContext);
 }
Beispiel #2
0
            private void method_3(
                IList <Class908> chunks,
                DxfEntity entity,
                DrawContext.Wireframe drawContext)
            {
                LinkedListNodeRef <Interface12> linkedListNodeRef = !this.bool_0 ? this.linkedListNodeRef_0 : this.linkedListNodeRef_1;
                bool?nullable0 = this.nullable_0;

                if ((!nullable0.GetValueOrDefault() ? 1 : (!nullable0.HasValue ? 1 : 0)) != 0)
                {
                    linkedListNodeRef.Insert((Interface12) new Class807());
                    this.nullable_0 = new bool?(true);
                }
                System.Drawing.Color color = (System.Drawing.Color) this.GetColor(drawContext.GetPlotColor(entity));
                short lineWeight           = drawContext.GetLineWeight(entity);

                foreach (Class908 chunk in (IEnumerable <Class908>)chunks)
                {
                    Class1036 class1036 = new Class1036(chunk, color, lineWeight);
                    linkedListNodeRef.Insert((Interface12)class1036);
                }
            }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory 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);
            IClippingTransformer clippingTransformer = (IClippingTransformer)context.GetTransformer().Clone();
            Matrix4D             preTransform        = Transformation4D.Translation((WW.Math.Vector3D) this.point3D_3);

            clippingTransformer.SetPreTransform(preTransform);
            Matrix4D matrix = clippingTransformer.Matrix;

            WW.Math.Point3D zero = WW.Math.Point3D.Zero;
            Vector4D        transformedOrigin = matrix.TransformTo4D(zero);
            Vector4D        transformedXAxis  = matrix.TransformTo4D(zero + WW.Math.Vector3D.XAxis);
            Vector4D        transformedYAxis  = matrix.TransformTo4D(zero + WW.Math.Vector3D.YAxis);

            graphicsFactory.CreateScalableImage((DxfEntity)this, context, (IBitmapProvider)this, polyline4DList[0], new Size2D((this.point3D_2 - this.point3D_3).GetLength(), (this.point3D_0 - this.point3D_3).GetLength()), transformedOrigin, transformedXAxis, transformedYAxis);
            if (polylines4D.Count > 0)
            {
                graphicsFactory.CreatePath((DxfEntity)this, context, context.GetPlotColor((DxfEntity)this), false, polylines4D, false, true);
            }
            if (shapes == null)
            {
                return;
            }
            Class940.smethod_23((IPathDrawer) new ns0.Class0((DxfEntity)this, context, graphicsFactory), (IEnumerable <IShape4D>)shapes, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this));
        }
Beispiel #5
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);
            }
        }
Beispiel #6
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));
        }
Beispiel #7
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);
        }
Beispiel #8
0
 public override void DrawInternal(
     DrawContext.Wireframe context,
     IWireframeGraphicsFactory2 graphicsFactory)
 {
     this.DrawInternal((IPathDrawer) new Class396((DxfEntity)this, context, graphicsFactory), this.Color.ToColor(), context.GetLineWeight((DxfEntity)this));
 }
Beispiel #9
0
            public void CreatePath(
                DxfEntity entity,
                DrawContext.Wireframe drawContext,
                ArgbColor color,
                bool forText,
                IList <Polyline4D> polylines,
                bool fill,
                bool correctForBackgroundColor)
            {
                if (polylines.Count <= 0)
                {
                    return;
                }
                Interface23[] drawables = this.GetDrawables(polylines);
                Interface12   drawable  = !correctForBackgroundColor ? (drawables.Length != 1 ? (Interface12) new Class346(this.GetColor(color), drawables, fill, drawContext.GetLineWeight(entity)) : (Interface12) new Class337(this.GetColor(color), drawables[0], fill, drawContext.GetLineWeight(entity))) : (drawables.Length != 1 ? (Interface12) new Class340(this.GetColor(color), drawables, fill, drawContext.GetLineWeight(entity)) : (Interface12) new Class341(this.GetColor(color), drawables[0], fill, drawContext.GetLineWeight(entity)));

                this.method_4(forText, drawable);
            }
Beispiel #10
0
 public void CreateXLine(
     DxfEntity entity,
     DrawContext.Wireframe drawContext,
     ArgbColor color,
     Vector4D?startPoint,
     Segment4D segment)
 {
     this.method_4(false, (Interface12) new Class345(startPoint, segment, this.GetColor(color), drawContext.GetLineWeight(entity)));
 }
Beispiel #11
0
            public void CreateLine(
                DxfEntity entity,
                DrawContext.Wireframe drawContext,
                ArgbColor color,
                bool forText,
                Vector4D start,
                Vector4D end)
            {
                Interface12 drawable = (Interface12) new Class338(start, end, this.GetColor(color), drawContext.GetLineWeight(entity));

                this.method_4(forText, drawable);
            }
Beispiel #12
0
            public void CreateDot(
                DxfEntity entity,
                DrawContext.Wireframe drawContext,
                ArgbColor color,
                bool forText,
                Vector4D position)
            {
                Interface12 drawable = (Interface12) new Class343(position, this.GetColor(color), drawContext.GetLineWeight(entity));

                this.method_4(forText, drawable);
            }
Beispiel #13
0
 public void CreateImage(
     DxfRasterImage rasterImage,
     DrawContext.Wireframe drawContext,
     Polyline4D clipPolygon,
     Polyline4D imageBoundary,
     Vector4D transformedOrigin,
     Vector4D transformedXAxis,
     Vector4D transformedYAxis)
 {
     if (!this.graphicsConfig_0.DrawImages || rasterImage.ImageDef == null || !rasterImage.ImageDef.Bitmap.IsValid)
     {
         return;
     }
     this.method_4(false, (Interface12) new Class344((Image)rasterImage.ImageDef.Bitmap.Image, clipPolygon, imageBoundary, transformedOrigin, transformedXAxis, transformedYAxis, (System.Drawing.Color)drawContext.GetPlotColor((DxfEntity)rasterImage), drawContext.GetLineWeight((DxfEntity)rasterImage)));
 }
Beispiel #14
0
            public void CreateMText(DxfMText text, DrawContext.Wireframe drawContext)
            {
                if (text.Text == null || text.Text.Trim() == string.Empty)
                {
                    return;
                }
                Bounds2D            collectBounds       = new Bounds2D();
                IList <Class908>    chunks              = Class666.smethod_4(text, text.Color.ToColor(), drawContext.GetLineWeight((DxfEntity)text), drawContext.GetTransformer().Matrix, collectBounds);
                BackgroundFillFlags backgroundFillFlags = text.BackgroundFillFlags;
                BackgroundFillInfo  backgroundFillInfo  = text.BackgroundFillInfo;

                if (backgroundFillFlags == BackgroundFillFlags.UseBackgroundFillColor && backgroundFillInfo != null)
                {
                    System.Drawing.Color color = (System.Drawing.Color)DxfEntity.GetColor(this.graphicsConfig_0.IndexedColors, backgroundFillInfo.Color, drawContext.ByBlockColor, drawContext.ByBlockDxfColor, text.GetLayer((DrawContext)drawContext));
                    double num1  = text.Height * (backgroundFillInfo.BorderOffsetFactor - 1.0);
                    double x1    = collectBounds.Center.X;
                    double y1    = collectBounds.Center.Y;
                    double width = text.Width;
                    double y2    = collectBounds.Delta.Y;
                    double num2;
                    double num3;
                    switch (text.AttachmentPoint)
                    {
                    case AttachmentPoint.TopLeft:
                        num2 = collectBounds.Corner1.X + 0.5 * width;
                        num3 = collectBounds.Corner2.Y - 0.5 * y2;
                        break;

                    case AttachmentPoint.TopCenter:
                        num2 = collectBounds.Center.X;
                        num3 = collectBounds.Corner2.Y - 0.5 * y2;
                        break;

                    case AttachmentPoint.TopRight:
                        num2 = collectBounds.Corner2.X - 0.5 * width;
                        num3 = collectBounds.Corner2.Y - 0.5 * y2;
                        break;

                    case AttachmentPoint.MiddleLeft:
                        num2 = collectBounds.Corner1.X + 0.5 * width;
                        num3 = collectBounds.Center.Y;
                        break;

                    case AttachmentPoint.MiddleCenter:
                        num2 = collectBounds.Center.X;
                        num3 = collectBounds.Center.Y;
                        break;

                    case AttachmentPoint.MiddleRight:
                        num2 = collectBounds.Corner2.X - 0.5 * width;
                        num3 = collectBounds.Center.Y;
                        break;

                    case AttachmentPoint.BottomLeft:
                        num2 = collectBounds.Corner1.X + 0.5 * width;
                        num3 = collectBounds.Corner1.Y + 0.5 * y2;
                        break;

                    case AttachmentPoint.BottomCenter:
                        num2 = collectBounds.Center.X;
                        num3 = collectBounds.Corner1.Y + 0.5 * y2;
                        break;

                    case AttachmentPoint.BottomRight:
                        num2 = collectBounds.Corner2.X - 0.5 * width;
                        num3 = collectBounds.Corner1.Y + 0.5 * y2;
                        break;

                    default:
                        num2 = collectBounds.Center.X;
                        num3 = collectBounds.Center.Y;
                        break;
                    }
                    short           lineWeight = drawContext.GetLineWeight((DxfEntity)text);
                    Matrix4D        matrix4D   = drawContext.GetTransformer().Matrix *text.Transform;
                    WW.Math.Point2D point      = new WW.Math.Point2D(num2 - 0.5 * width - num1, num3 - 0.5 * y2 - num1);
                    double          x2         = width + 2.0 * num1;
                    double          y3         = y2 + 2.0 * num1;
                    this.method_4(false, (Interface12) new Class341((ArgbColor)color, (Interface23) new Class535(true, new Vector4D[4]
                    {
                        matrix4D.TransformTo4D(point),
                        matrix4D.TransformTo4D(point + new Vector2D(x2, 0.0)),
                        matrix4D.TransformTo4D(point + new Vector2D(x2, y3)),
                        matrix4D.TransformTo4D(point + new Vector2D(0.0, y3))
                    }), true, lineWeight));
                }
                this.method_3(chunks, (DxfEntity)text, drawContext);
            }
Beispiel #15
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);
            ArgbColor plotColor = context.GetPlotColor((DxfEntity)this);

            if (polylines4D.Count > 0)
            {
                Class940.smethod_3((DxfEntity)this, context, graphicsFactory, plotColor, 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));
        }
Beispiel #16
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 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 Class396((DxfEntity)this, context, graphicsFactory).DrawPath(shapeByIndex.GetGlyphShape(false, out endPoint), this.Transform, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this), false, false, this.double_1);
        }
Beispiel #17
0
        protected void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory,
            double startAngle,
            double endAngle)
        {
            IList <Polyline4D>  polylines4D;
            IList <FlatShape4D> shapes;

            this.GetPolylines4D((DrawContext)context, context.GetTransformer(), startAngle, endAngle, 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));
        }
Beispiel #18
0
            public void CreateShape(
                DxfEntity entity,
                DrawContext.Wireframe drawContext,
                ArgbColor color,
                bool forText,
                IShape4D shape)
            {
                Interface12 drawable = (Interface12) new Class342(this.GetColor(color), shape, shape.IsFilled ? (short)0 : drawContext.GetLineWeight(entity));

                this.method_4(forText, drawable);
            }