Esempio n. 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);
 }
Esempio n. 2
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. 3
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. 4
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);
            }