Esempio n. 1
0
        private void DrawInternal(IPathDrawer pathDrawer, Color color, short lineWeight)
        {
            DxfTolerance.Class397[] class397Array = this.method_13();
            Matrix4D transform = this.Transform;
            Vector3D zero      = Vector3D.Zero;
            double   num1      = this.dxfDimensionStyleOverrides_0.TextHeight * 2.0;
            double   scale     = this.dxfDimensionStyleOverrides_0.ScaleFactor;

            if (System.Math.Abs(scale) < 1E-10)
            {
                scale = 1.0;
            }
            if (this.IsAnnotative)
            {
                scale /= DxfAnnotationScaleObjectContextData.smethod_9((DxfEntity)this, this.Model.Header.CurrentAnnotationScale);
            }
            double num2 = num1 * scale;

            foreach (DxfTolerance.Class397 class397 in class397Array)
            {
                double num3 = class397.Draw(this, pathDrawer, transform * Transformation4D.Translation(zero), color, lineWeight, scale);
                if (class397.NewLineAfterField)
                {
                    zero.X  = 0.0;
                    zero.Y -= num2;
                }
                else
                {
                    zero.X += num3;
                }
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 3
0
        public override void DrawInternal(
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory)
        {
            graphicsFactory.SetColor(context.GetPlotColor((DxfEntity)this));
            IList <WW.Math.Geometry.Polyline3D> polylines;
            IList <FlatShape4D> shapes;

            this.GetPolylines((DrawContext)context, context.GetTransformer().LineTypeScaler, out polylines, out shapes);
            if (this.double_1 != 0.0)
            {
                Class940.Extrude((DxfEntity)this, context, graphicsFactory, polylines, false, this.double_1 * this.vector3D_0);
            }
            else
            {
                Class940.smethod_16((DxfEntity)this, context, graphicsFactory, polylines, false);
            }
            if (shapes == null)
            {
                return;
            }
            IPathDrawer pathDrawer = (IPathDrawer) new Class473((DxfEntity)this, context, graphicsFactory);

            foreach (FlatShape4D flatShape4D in (IEnumerable <FlatShape4D>)shapes)
            {
                pathDrawer.DrawPath(flatShape4D.FlatShape, flatShape4D.Transformation, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this), flatShape4D.IsFilled, false, this.double_1);
            }
        }
Esempio n. 4
0
 public void Draw(
     IPathDrawer drawer,
     Matrix4D trafo,
     Color color,
     short lineWeight,
     double extent)
 {
     this.interface35_0.Draw(drawer, trafo, color, lineWeight, extent);
 }
Esempio n. 5
0
 public void Draw(
     IPathDrawer drawer,
     Matrix4D trafo,
     Color color,
     short lineWeight,
     double extent)
 {
     drawer.DrawPath(this.ishape2D_0, trafo, color, lineWeight, this.bool_0, true, extent);
 }
Esempio n. 6
0
 internal static void smethod_23(
     IPathDrawer pathDrawer,
     IEnumerable <IShape4D> shapes,
     WW.Cad.Model.Color color,
     short lineWeight)
 {
     foreach (IShape4D shape in shapes)
     {
         pathDrawer.DrawPath(shape, color, lineWeight);
     }
 }
Esempio n. 7
0
 public void UpdateDrawMethod(bool distanceMethod)
 {
     if (distanceMethod)
     {
         pathDrawer = new DistanceDrawer();
     }
     else
     {
         pathDrawer = new LineDrawer();
     }
 }
Esempio n. 8
0
 internal static void smethod_24(
     IPathDrawer pathDrawer,
     IEnumerable <FlatShape4D> shapes,
     WW.Cad.Model.Color color,
     short lineWeight,
     double extrusion)
 {
     foreach (FlatShape4D shape in shapes)
     {
         pathDrawer.DrawPath(shape.FlatShape, shape.Transformation, color, lineWeight, shape.IsFilled, false, extrusion);
     }
 }
Esempio n. 9
0
        public void method_1(IPathDrawer drawer, Matrix4D insertionTransformation, double extrusion)
        {
            if (this.ishape2D_1 == null)
            {
                return;
            }
            Matrix4D transform = insertionTransformation * this.Transformation;

            foreach (IShape2D path in this.ishape2D_1)
            {
                drawer.DrawPath(path, transform, this.interface34_0.Color, this.interface34_0.LineWeight, false, true, extrusion);
            }
        }
Esempio n. 10
0
        public Vector3D Draw(IPathDrawer drawer, Matrix4D transformation, double extrusion)
        {
            Matrix4D matrix4D  = Matrix4D.Multiply(transformation, this.matrix2D_0);
            Vector2D zero      = Vector2D.Zero;
            Matrix4D transform = matrix4D;

            foreach (Interface35 nterface35 in this.interface35_0)
            {
                drawer.DrawPath(nterface35.Path, transform, this.color_0, this.short_0, this.Filled, true, extrusion);
                zero     += nterface35.Advance;
                transform = matrix4D * Transformation4D.Translation(new Vector3D(zero.X * this.double_0, zero.Y, 0.0));
            }
            return((Vector3D)transform.TransformTo3D((WW.Math.Point2D) this.vector2D_0));
        }
Esempio n. 11
0
        public void Draw(IPathDrawer drawer, Matrix4D insertionTransformation, double extrusion)
        {
            Matrix4D matrix4D = insertionTransformation * this.Transformation;

            this.interface34_0.Draw(drawer, matrix4D, extrusion);
            if (this.ishape2D_1 == null)
            {
                return;
            }
            foreach (IShape2D path in this.ishape2D_1)
            {
                drawer.DrawPath(path, matrix4D, this.interface34_0.Color, this.interface34_0.LineWeight, false, true, extrusion);
            }
        }
Esempio n. 12
0
        public void Draw(Class385 context)
        {
            Font     systemFont = this.class908_0.Font.SystemFont;
            Graphics graphics   = context.Graphics;
            Matrix4D transform1 = context.Transform;

            if (systemFont != null)
            {
                double      fontHeight = this.class908_0.Font.Metrics.FontHeight;
                ns4.Class26 metrics    = (ns4.Class26) this.class908_0.Font.Metrics;
                double      num        = metrics.CanonicalScaling * fontHeight;
                Matrix4D    matrix4D   = transform1 * this.class908_0.Transformation * Transformation4D.Scaling(num, -num, num);
                Matrix      transform2 = graphics.Transform;
                using (Matrix matrix = new Matrix((float)matrix4D.M00, (float)matrix4D.M10, (float)matrix4D.M01, (float)matrix4D.M11, (float)matrix4D.M03, (float)matrix4D.M13))
                {
                    graphics.Transform         = matrix;
                    context.solidBrush_0.Color = this.color_0;
                    graphics.DrawString(this.class908_0.Text.Text, systemFont, (Brush)context.solidBrush_0, metrics.BaseLineOffset.X, metrics.BaseLineOffset.Y, StringFormat.GenericTypographic);
                }
                graphics.Transform = transform2;
                if (this.class908_0.Linings.Length <= 0)
                {
                    return;
                }
                context.pen_0.Color = this.color_0;
                context.method_3(this.short_0);
                this.class908_0.method_1((IPathDrawer) new Class1036.Class1037(graphics, context.pen_0), transform1, 0.0);
            }
            else
            {
                context.pen_0.Color = this.color_0;
                context.method_3(this.short_0);
                IPathDrawer drawer = (IPathDrawer) new Class1036.Class1037(graphics, context.pen_0);
                this.class908_0.method_0(drawer, transform1, 0.0);
                if (this.class908_0.Linings.Length <= 0)
                {
                    return;
                }
                this.class908_0.method_1(drawer, transform1, 0.0);
            }
        }
Esempio n. 13
0
        public Vector3D Draw(IPathDrawer drawer, Matrix4D transformation, double extrusion)
        {
            Matrix4D a         = Matrix4D.Multiply(transformation, this.matrix2D_0);
            Matrix4D transform = Matrix4D.Multiply(a, this.matrix2D_1);

            if (this.ishape2D_0 != null)
            {
                if (drawer.IsSeparateCharDrawingPreferred())
                {
                    foreach (Class1063 splitPath in this.SplitPaths)
                    {
                        drawer.DrawCharPath(splitPath.Shape, a * DxfUtil.smethod_61(splitPath.Transform), this.color_0, this.short_0, this.Filled, extrusion);
                    }
                }
                else
                {
                    drawer.DrawPath(this.ishape2D_0, transform, this.color_0, this.short_0, this.Filled, true, extrusion);
                }
            }
            return((Vector3D)transform.TransformTo3D((WW.Math.Point2D) this.vector2D_0));
        }
Esempio n. 14
0
            internal double Draw(
                DxfTolerance tolerance,
                IPathDrawer pathDrawer,
                Matrix4D preTransform,
                Color color,
                short lineWeight,
                double scale)
            {
                double           effectiveTextHeight = DxfDimensionStyle.GetEffectiveTextHeight((IDimensionStyle)tolerance.DimensionStyleOverrides, scale);
                double           num1             = tolerance.dxfDimensionStyleOverrides_0.TextHeight * scale;
                float            num2             = (float)(num1 * 0.5);
                Class985         resultLayoutInfo = new Class985();
                IList <Class908> class908List     = Class666.smethod_0(this.string_0, effectiveTextHeight, tolerance.DimensionStyleOverrides.TextStyle, tolerance.DimensionStyleOverrides.TextStyle.WidthFactor, color, lineWeight, preTransform * Transformation4D.Translation((double)num2, 0.0, 0.0), resultLayoutInfo, Enum24.flag_3);
                float            x           = (float)resultLayoutInfo.Bounds.Corner2.X;
                float            num3        = (float)(num1 * 2.0 * 0.5);
                Rectangle2D      rectangle2D = new Rectangle2D(0.0, -(double)num3, (double)x + (double)num2 * 2.0, 2.0 * (double)num3 - (double)num3);

                pathDrawer.DrawPath((IShape2D)rectangle2D, preTransform, color, lineWeight, false, false, 0.0);
                foreach (Class908 class908 in (IEnumerable <Class908>)class908List)
                {
                    class908.Draw(pathDrawer, Matrix4D.Identity, 0.0);
                }
                return((double)x + (double)num2 * 2.0);
            }
Esempio n. 15
0
        private void method_16(DrawContext context, IPathDrawer pathDrawer)
        {
            Bounds2D         collectBounds = new Bounds2D();
            IList <Class908> class908List  = Class666.smethod_4(this, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this), Matrix4D.Identity, collectBounds);

            if (this.backgroundFillFlags_0 == BackgroundFillFlags.UseBackgroundFillColor && this.backgroundFillInfo_0 != null)
            {
                double num1 = this.double_1 * (this.backgroundFillInfo_0.BorderOffsetFactor - 1.0);
                double num2 = this.double_2 == 0.0 ? collectBounds.Delta.X : this.double_2;
                double y    = collectBounds.Delta.Y;
                double num3;
                double num4;
                switch (this.AttachmentPoint)
                {
                case AttachmentPoint.TopLeft:
                    num3 = collectBounds.Corner1.X + 0.5 * num2;
                    num4 = collectBounds.Corner2.Y - 0.5 * y;
                    break;

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

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

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

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

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

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

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

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

                default:
                    num3 = collectBounds.Center.X;
                    num4 = collectBounds.Center.Y;
                    break;
                }
                pathDrawer.DrawPath((IShape2D) new Rectangle2D(num3 - 0.5 * num2 - num1, num4 - 0.5 * y - num1, num3 + 0.5 * num2 + num1, num4 + 0.5 * y + num1), this.Transform, this.backgroundFillInfo_0.Color, context.GetLineWeight((DxfEntity)this), true, false, 0.0);
            }
            foreach (Class908 class908 in (IEnumerable <Class908>)class908List)
            {
                class908.Draw(pathDrawer, Matrix4D.Identity, 0.0);
            }
        }
Esempio n. 16
0
 public ClippingPathDrawerWrapper(IClippingTransformer transformer, IPathDrawer wrapped)
 {
     this.iclippingTransformer_0 = transformer;
     this.ipathDrawer_0          = wrapped;
 }
Esempio n. 17
0
        public void method_0(IPathDrawer drawer, Matrix4D insertionTransformation, double extrusion)
        {
            Matrix4D transformation = insertionTransformation * this.Transformation;

            this.interface34_0.Draw(drawer, transformation, extrusion);
        }