Esempio n. 1
0
            internal static Polyline2D2N smethod_0(
                IVertex2DCollection vertices,
                GraphicsConfig config,
                bool closed)
            {
                int count = vertices.Count;

                if (count == 0)
                {
                    return(new Polyline2D2N(0));
                }
                IVertex2D    vertex   = vertices.GetIVertex2D(0);
                Polyline2D2N polyline = new Polyline2D2N(count, closed);

                for (int index = 1; index < count; ++index)
                {
                    IVertex2D ivertex2D = vertices.GetIVertex2D(index);
                    Class639.Class641.smethod_1(config, polyline, vertex, ivertex2D);
                    vertex = ivertex2D;
                }
                if (closed)
                {
                    Class639.Class641.smethod_1(config, polyline, vertex, vertices.GetIVertex2D(0));
                }
                else
                {
                    Point2D2N point2D2N = new Point2D2N(vertex.Position);
                    polyline.Add(point2D2N);
                }
                return(polyline);
            }
Esempio n. 2
0
        internal Polyline2D2WN method_0(
            IVertex2DCollection vertices,
            GraphicsConfig config,
            bool closed)
        {
            int count = vertices.Count;

            if (count == 0)
            {
                return(new Polyline2D2WN(0));
            }
            IVertex2D     vertex   = vertices.GetIVertex2D(0);
            Polyline2D2WN polyline = new Polyline2D2WN(count, closed);

            for (int index = 1; index < count; ++index)
            {
                IVertex2D ivertex2D = vertices.GetIVertex2D(index);
                this.method_1(config, polyline, vertex, ivertex2D);
                vertex = ivertex2D;
            }
            if (closed)
            {
                this.method_1(config, polyline, vertex, vertices.GetIVertex2D(0));
            }
            else
            {
                double     startWidth = vertex.StartWidth == 0.0 ? this.double_0 : vertex.StartWidth;
                double     endWidth   = vertex.EndWidth == 0.0 ? this.double_1 : vertex.EndWidth;
                Point2D2WN point2D2Wn = new Point2D2WN(vertex.Position, startWidth, endWidth);
                polyline.Add(point2D2Wn);
            }
            return(polyline);
        }
Esempio n. 3
0
        internal static void smethod_12(
            DrawContext context,
            IVertex2DCollection vertices,
            bool closed,
            Matrix4D transform,
            double thickness,
            double defaultStartWidth,
            double defaultEndWidth,
            WW.Cad.Drawing.Surface.Geometry geometry)
        {
            bool flag;

            if (flag = defaultStartWidth == 0.0 && defaultEndWidth == 0.0)
            {
                int num = closed ? vertices.Count : vertices.Count - 1;
                for (int index = 0; index < num; ++index)
                {
                    IVertex2D ivertex2D = vertices.GetIVertex2D(index);
                    if (ivertex2D.StartWidth != 0.0 || ivertex2D.EndWidth != 0.0)
                    {
                        flag = false;
                        break;
                    }
                }
            }
            if (flag)
            {
                if (thickness == 0.0)
                {
                    geometry.Add((IPrimitive) new WW.Cad.Drawing.Surface.Polyline2DE(Class639.Class640.smethod_0(vertices, context.Config, closed), transform));
                }
                else
                {
                    geometry.Add((IPrimitive) new WW.Cad.Drawing.Surface.Polyline2D2N(Class639.Class641.smethod_0(vertices, context.Config, closed), transform));
                }
            }
            else if (thickness == 0.0)
            {
                WW.Cad.Drawing.Polyline2D2WN wrappee = new Class639(defaultStartWidth, defaultEndWidth).method_0(vertices, context.Config, closed);
                if (wrappee == null || wrappee.Count <= 0)
                {
                    return;
                }
                geometry.Add((IPrimitive) new WW.Cad.Drawing.Surface.Polyline2D2WN(wrappee, context.Model.Header.FillMode, transform));
            }
            else
            {
                WW.Cad.Drawing.Polyline2D2WN wrappee = new Class639(defaultStartWidth, defaultEndWidth).method_0(vertices, context.Config, closed);
                if (wrappee == null || wrappee.Count <= 0)
                {
                    return;
                }
                geometry.Add((IPrimitive) new WW.Cad.Drawing.Surface.Polyline2D2WN(wrappee, context.Model.Header.FillMode, transform));
            }
        }