Exemple #1
0
            public void CreateShape(DxfEntity entity, IShape4D shape)
            {
                if (shape.IsEmpty)
                {
                    return;
                }
                WW.Math.Point2D[]  points    = new WW.Math.Point2D[3];
                List <bool>        boolList  = new List <bool>();
                ISegment2DIterator iterator1 = shape.CreateIterator(this.matrix4D_0);

                while (iterator1.MoveNext())
                {
                    switch (iterator1.CurrentType)
                    {
                    case SegmentType.MoveTo:
                        boolList.Add(false);
                        continue;

                    case SegmentType.Close:
                        boolList[boolList.Count - 1] = true;
                        continue;

                    default:
                        continue;
                    }
                }
                int num = 0;
                List <System.Windows.Point> pointList = new List <System.Windows.Point>();
                ISegment2DIterator          iterator2 = shape.CreateIterator(this.matrix4D_0);

                while (iterator2.MoveNext())
                {
                    switch (iterator2.Current(points, 0))
                    {
                    case SegmentType.MoveTo:
                        this.class453_0.method_1((System.Windows.Point)points[0], this.class453_0.Fill, boolList[num++]);
                        continue;

                    case SegmentType.LineTo:
                        this.class453_0.method_4((System.Windows.Point)points[0]);
                        continue;

                    case SegmentType.QuadTo:
                        pointList.Clear();
                        pointList.Add((System.Windows.Point)points[0]);
                        pointList.Add((System.Windows.Point)points[1]);
                        this.class453_0.method_6((IList <System.Windows.Point>)pointList);
                        continue;

                    case SegmentType.CubicTo:
                        pointList.Clear();
                        pointList.Add((System.Windows.Point)points[0]);
                        pointList.Add((System.Windows.Point)points[1]);
                        pointList.Add((System.Windows.Point)points[2]);
                        this.class453_0.method_8((IList <System.Windows.Point>)pointList);
                        continue;

                    default:
                        continue;
                    }
                }
            }
Exemple #2
0
            private bool method_5(IShape4D shape)
            {
                if (shape.IsEmpty)
                {
                    return(false);
                }
                StringBuilder stringBuilder = this.stack_0.Peek().StringBuilder;

                WW.Math.Point2D[]  points      = new WW.Math.Point2D[3];
                SegmentType        segmentType = SegmentType.MoveTo;
                ISegment2DIterator iterator    = shape.CreateIterator(this.xamlExporter_0.matrix4D_0);

                while (iterator.MoveNext())
                {
                    switch (iterator.Current(points, 0))
                    {
                    case SegmentType.MoveTo:
                        stringBuilder.Append('M');
                        stringBuilder.Append(points[0].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        stringBuilder.Append(',');
                        stringBuilder.Append(points[0].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        segmentType = SegmentType.MoveTo;
                        break;

                    case SegmentType.LineTo:
                        if (segmentType != SegmentType.LineTo)
                        {
                            stringBuilder.Append('L');
                        }
                        stringBuilder.Append(points[0].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        stringBuilder.Append(',');
                        stringBuilder.Append(points[0].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        segmentType = SegmentType.LineTo;
                        break;

                    case SegmentType.QuadTo:
                        if (segmentType != SegmentType.QuadTo)
                        {
                            stringBuilder.Append('Q');
                        }
                        stringBuilder.Append(points[0].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        stringBuilder.Append(',');
                        stringBuilder.Append(points[0].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        stringBuilder.Append(' ');
                        stringBuilder.Append(points[1].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        stringBuilder.Append(',');
                        stringBuilder.Append(points[1].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        segmentType = SegmentType.QuadTo;
                        break;

                    case SegmentType.CubicTo:
                        if (segmentType != SegmentType.CubicTo)
                        {
                            stringBuilder.Append('C');
                        }
                        stringBuilder.Append(points[0].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        stringBuilder.Append(',');
                        stringBuilder.Append(points[0].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        stringBuilder.Append(' ');
                        stringBuilder.Append(points[1].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        stringBuilder.Append(',');
                        stringBuilder.Append(points[1].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        stringBuilder.Append(' ');
                        stringBuilder.Append(points[2].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        stringBuilder.Append(',');
                        stringBuilder.Append(points[2].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture));
                        segmentType = SegmentType.CubicTo;
                        break;

                    case SegmentType.Close:
                        stringBuilder.Append('Z');
                        segmentType = SegmentType.Close;
                        break;
                    }
                    stringBuilder.Append(' ');
                }
                return(true);
            }