Beispiel #1
0
        public virtual Interface24[] imethod_1(double width, Interface25 breaker)
        {
            if (this.GetBounds(Enum24.flag_1, (Class985)null).Corner2.X > width)
            {
                Class425 class425_1 = this.vmethod_0(true);
                class425_1.Offset = this.Offset;
                using (LinkedList <Interface24> .Enumerator enumerator = this.linkedList_0.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Interface24 current = enumerator.Current;
                        if (current.Breakable)
                        {
                            Interface24[] nterface24Array = current.imethod_1(width, breaker);
                            switch (nterface24Array.Length)
                            {
                            case 0:
                                if (class425_1.linkedList_0.Count <= 0)
                                {
                                    return(Class470.interface24_0);
                                }
                                Class425 class425_2 = this.vmethod_0(false);
                                class425_2.method_0(current);
                                while (enumerator.MoveNext())
                                {
                                    class425_2.method_0(enumerator.Current);
                                }
                                return(new Interface24[2] {
                                    (Interface24)class425_1, (Interface24)class425_2
                                });

                            case 1:
                                class425_1.method_0(current);
                                continue;

                            case 2:
                                class425_1.method_0(nterface24Array[0]);
                                Class425 class425_3 = this.vmethod_0(false);
                                class425_3.method_0(nterface24Array[1]);
                                while (enumerator.MoveNext())
                                {
                                    class425_3.method_0(enumerator.Current);
                                }
                                return(new Interface24[2] {
                                    (Interface24)class425_1, (Interface24)class425_3
                                });

                            default:
                                continue;
                            }
                        }
                        else if (current.GetBounds(Enum24.flag_1, (Class985)null).Corner2.X <= width)
                        {
                            class425_1.method_0(current);
                        }
                        else
                        {
                            if (class425_1.linkedList_0.Count <= 0)
                            {
                                return(Class470.interface24_0);
                            }
                            Class425 class425_2 = this.vmethod_0(false);
                            class425_2.method_0(current);
                            while (enumerator.MoveNext())
                            {
                                class425_2.method_0(enumerator.Current);
                            }
                            return(new Interface24[2] {
                                (Interface24)class425_1, (Interface24)class425_2
                            });
                        }
                    }
                }
                return(Class470.interface24_0);
            }
            return(new Interface24[1] {
                (Interface24)this
            });
        }
Beispiel #2
0
        internal static IList <Class908> smethod_6(
            DxfText text,
            Color color,
            short lineWeight,
            Matrix4D insertionTransformation,
            Bounds2D collectBounds,
            out Vector2D alignmentTranslation,
            out Vector2D alignmentScaling)
        {
            Class425 class425 = Class594.smethod_10(text.DisplayString, text.Height, text.ObliqueAngle, text.WidthFactor, text.Style, color);
            Vector2D zero     = Vector2D.Zero;

            class425.imethod_0(ref zero, text.Height, Enum24.flag_3);
            alignmentTranslation = Vector2D.Zero;
            Bounds2D bounds = class425.GetBounds(Enum24.flag_0, (Class985)null);

            if (zero != Vector2D.Zero)
            {
                bounds.Update(0.0, 0.0);
                bounds.Update(zero.X, zero.Y);
            }
            double x = 1.0;
            double y = 1.0;

            if (bounds.Initialized && text.AlignmentPoint2.HasValue)
            {
                if (text.VerticalAlignment != TextVerticalAlignment.Baseline)
                {
                    switch (text.VerticalAlignment)
                    {
                    case TextVerticalAlignment.Bottom:
                        alignmentTranslation.Y = class425.Blocks.Count > 0 ? class425.Blocks.First.Value.Settings.Font.Metrics.Descent : -bounds.Min.Y;
                        break;

                    case TextVerticalAlignment.Middle:
                        alignmentTranslation.Y = -0.5 * text.Height;
                        break;

                    case TextVerticalAlignment.Top:
                        alignmentTranslation.Y = -text.Height;
                        break;
                    }
                }
                switch (text.HorizontalAlignment)
                {
                case TextHorizontalAlignment.Left:
                    alignmentTranslation.X = -bounds.Corner1.X;
                    break;

                case TextHorizontalAlignment.Center:
                    alignmentTranslation.X = -bounds.Center.X;
                    break;

                case TextHorizontalAlignment.Right:
                    alignmentTranslation.X = -bounds.Corner2.X;
                    break;

                case TextHorizontalAlignment.Aligned:
                    x      = (text.AlignmentPoint2.Value - text.AlignmentPoint1).GetLength() / bounds.Delta.X;
                    y      = x;
                    bounds = new Bounds2D(new WW.Math.Point2D(bounds.Corner1.X, y * bounds.Corner1.Y), new WW.Math.Point2D(bounds.Corner1.X + x * bounds.Delta.X, y * bounds.Corner2.Y));
                    alignmentTranslation.X = -bounds.Corner2.X;
                    break;

                case TextHorizontalAlignment.Middle:
                    alignmentTranslation.Y = -bounds.Center.Y;
                    alignmentTranslation.X = -bounds.Center.X;
                    break;

                case TextHorizontalAlignment.Fit:
                    x      = (text.AlignmentPoint2.Value - text.AlignmentPoint1).GetLength() / bounds.Delta.X;
                    bounds = new Bounds2D(bounds.Corner1, new WW.Math.Point2D(bounds.Corner1.X + x * bounds.Delta.X, bounds.Corner2.Y));
                    alignmentTranslation.X = -bounds.Corner2.X;
                    break;
                }
            }
            IList <Class908> class908List = (IList <Class908>) new List <Class908>();

            class425.imethod_3((ICollection <Class908>)class908List, insertionTransformation * Transformation4D.Translation(alignmentTranslation.X, alignmentTranslation.Y, 0.0) * Transformation4D.Scaling(x, y, 1.0), lineWeight);
            if (collectBounds != null)
            {
                bounds.Move(alignmentTranslation.X, alignmentTranslation.Y);
                collectBounds.Update(bounds);
            }
            alignmentScaling = new Vector2D(x, y);
            return(class908List);
        }