Example #1
0
        private WW.Cad.Drawing.Polyline2DE method_25(
            DxfVertex2DCollection points,
            bool isInterpolated)
        {
            bool closed = this.Closed;
            int  count  = points.Count;

            WW.Cad.Drawing.Polyline2DE polyline2De = new WW.Cad.Drawing.Polyline2DE(count, closed);
            if (count > 0)
            {
                DxfVertex2D dxfVertex2D = points[0];
                polyline2De.Add(new Point2DE(dxfVertex2D.Position)
                {
                    IsInterpolatedPoint = isInterpolated
                });
                for (int index = 1; index < count; ++index)
                {
                    DxfVertex2D point = points[index];
                    if (!(dxfVertex2D.Position == point.Position))
                    {
                        polyline2De.Add(new Point2DE(point.Position)
                        {
                            IsInterpolatedPoint = isInterpolated
                        });
                        dxfVertex2D = point;
                    }
                }
                if (closed && count > 1 && polyline2De[0].Position == polyline2De[polyline2De.Count - 1].Position)
                {
                    polyline2De.RemoveAt(polyline2De.Count - 1);
                }
            }
            return(polyline2De);
        }
Example #2
0
        private Polyline2D method_24(DxfVertex2DCollection points)
        {
            bool       closed     = this.Closed;
            int        count      = points.Count;
            Polyline2D polyline2D = new Polyline2D(count, closed);

            if (count > 0)
            {
                DxfVertex2D dxfVertex2D = points[0];
                polyline2D.Add(dxfVertex2D.Position);
                for (int index = 1; index < count; ++index)
                {
                    DxfVertex2D point = points[index];
                    if (!(dxfVertex2D.Position == point.Position))
                    {
                        polyline2D.Add(point.Position);
                        dxfVertex2D = point;
                    }
                }
                if (closed && count > 1 && polyline2D[0] == polyline2D[polyline2D.Count - 1])
                {
                    polyline2D.RemoveAt(polyline2D.Count - 1);
                }
            }
            return(polyline2D);
        }
Example #3
0
        private WW.Cad.Drawing.Polyline2D2WN method_27(
            DxfVertex2DCollection points,
            bool isInterpolatedPoint)
        {
            bool closed = this.Closed;
            int  count  = points.Count;

            WW.Cad.Drawing.Polyline2D2WN polyline2D2Wn = new WW.Cad.Drawing.Polyline2D2WN(count, closed);
            if (count > 0)
            {
                DxfVertex2D dxfVertex2D = points[0];
                for (int index = 1; index < count; ++index)
                {
                    DxfVertex2D point = points[index];
                    if (!(dxfVertex2D.Position == point.Position))
                    {
                        Vector2D unit     = (point.Position - dxfVertex2D.Position).GetUnit();
                        Vector2D vector2D = new Vector2D(-unit.Y, unit.X);
                        polyline2D2Wn.Add(new Point2D2WN(dxfVertex2D.Position, dxfVertex2D.StartWidth, dxfVertex2D.EndWidth, vector2D, vector2D)
                        {
                            IsInterpolatedPoint = isInterpolatedPoint
                        });
                        dxfVertex2D = point;
                    }
                }
                if (closed)
                {
                    DxfVertex2D point = points[0];
                    if (dxfVertex2D.Position != point.Position)
                    {
                        Vector2D unit     = (point.Position - dxfVertex2D.Position).GetUnit();
                        Vector2D vector2D = new Vector2D(-unit.Y, unit.X);
                        polyline2D2Wn.Add(new Point2D2WN(dxfVertex2D.Position, dxfVertex2D.StartWidth, dxfVertex2D.EndWidth, vector2D, vector2D)
                        {
                            IsInterpolatedPoint = isInterpolatedPoint
                        });
                    }
                }
                else
                {
                    polyline2D2Wn.Add(new Point2D2WN(dxfVertex2D.Position)
                    {
                        IsInterpolatedPoint = isInterpolatedPoint
                    });
                }
            }
            return(polyline2D2Wn);
        }
Example #4
0
        private bool method_32(DxfVertex2DCollection vertices)
        {
            bool flag;

            if (flag = this.DefaultStartWidth == 0.0 && this.DefaultEndWidth == 0.0)
            {
                int num = this.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;
                    }
                }
            }
            return(flag);
        }