Beispiel #1
0
 public override void ExportAsDXF(DXFExport ADXFExport)
 {
     ADXFExport.AddName("TEXT", "AcDbText");
     ADXFExport.AddColor(this.data);
     ADXFExport.Add3DPoint(10, this.data.point);
     ADXFExport.AddFloat(40, ADXFExport.MM(this.data.height));
     if (this.data.fScale != 0f)
     {
         ADXFExport.AddFloat(41, this.data.fScale);
     }
     if (this.data.rotation != 0f)
     {
         ADXFExport.AddFloat(50, this.data.rotation);
     }
     if (this.data.flags != 0)
     {
         ADXFExport.AddFloat(51, 15f);
     }
     if (this.data.hAlign != 0 || this.data.vAlign != 0)
     {
         if (this.data.hAlign != 0)
         {
             ADXFExport.AddInt(72, (int)this.data.hAlign);
         }
         ADXFExport.Add3DPoint(11, this.data.point1);
     }
     ADXFExport.current.Add("  1");
     ADXFExport.current.Add(this.data.text);
     ADXFExport.current.Add("100");
     ADXFExport.current.Add("AcDbText");
     if (this.data.vAlign != 0)
     {
         ADXFExport.AddInt(73, (int)this.data.vAlign);
     }
 }
Beispiel #2
0
        public override void ExportAsDXF(DXFExport ADXFExport)
        {
            DXFPoint dXFPoint = new DXFPoint();

            if ((this.boundaries != null || this.boundaryType != HatchBoundaryType.hbtPolyPolyline) &&
                (this.boundaries.Count != 0 || this.boundaryType != HatchBoundaryType.hbtPolyPolyline))
            {
                dXFPoint.X = 0f;
                dXFPoint.Y = 0f;
                float aDXFExport = 0.05f;
                if (!DXFExport.use01MM)
                {
                    aDXFExport = aDXFExport * ADXFExport.fOffset;
                }
                ADXFExport.AddName(DXFTables.sHatchEntity, "AcDbHatch");
                ADXFExport.AddColor(this.data);
                ADXFExport.Add3DPoint(10, dXFPoint);
                ADXFExport.AddFloat(30, 0f);
                ADXFExport.AddFloat(210, 0f);
                ADXFExport.AddFloat(220, 0f);
                ADXFExport.AddFloat(230, 1f);
                ADXFExport.AddString(2, this.patternName);
                ADXFExport.AddInt(70, this.data.flags);
                ADXFExport.AddInt(71, 0);
                this.AddBoundaryPathData(ADXFExport);
                ADXFExport.AddInt(75, 0);
                ADXFExport.AddInt(76, 1);
                if (this.data.flags == 0)
                {
                    this.AddPatternData(aDXFExport, ADXFExport);
                }
                ADXFExport.AddInt(98, 1);
                ADXFExport.AddPoint(10, dXFPoint);
            }
        }
Beispiel #3
0
        public override void ExportAsDXF(DXFExport ADXFExport)
        {
            int i;

            if ((this.data.points.Count - 4) % 3 != 0)
            {
                base.ExportAsDXF(ADXFExport);
                return;
            }
            int   count  = this.data.points.Count - 1 + (int)Math.Floor((double)(this.data.points.Count / 3));
            float single = 1f / (float)count;

            ADXFExport.AddName("SPLINE", "AcDbSpline");
            ADXFExport.AddColor(this.data);
            ADXFExport.AddThickness(this.data);
            ADXFExport.Add3DPoint(210, new DXFPoint(0f, 0f, 1f));
            ADXFExport.AddInt(70, 8);
            ADXFExport.AddInt(71, 3);
            ADXFExport.AddInt(72, count + DXFTables.cnstAmount);
            ADXFExport.AddInt(73, count);
            ADXFExport.AddInt(74, 0);
            ADXFExport.AddFloat(42, 1E-07f);
            ADXFExport.AddFloat(43, 1E-07f);
            int   j       = 0;
            float single1 = 0f;

            while (j < count)
            {
                for (i = 0; i < DXFTables.cnstAmount; i++)
                {
                    ADXFExport.AddFloat(40, single1);
                }
                single1 = single1 + single;
                j       = j + DXFTables.cnstAmount;
            }
            single1 = 1f;
            for (i = 0; i < DXFTables.cnstAmount; i++)
            {
                ADXFExport.AddFloat(40, single1);
            }
            for (j = 0; j < this.data.points.Count; j++)
            {
                ADXFExport.Add3DPoint(10, (DXFPoint)this.data.points[j]);
                if (j % 3 == 0 && j != 0 && j != this.data.points.Count - 1)
                {
                    ADXFExport.Add3DPoint(10, (DXFPoint)this.data.points[j]);
                }
            }
        }
Beispiel #4
0
 public override void ExportAsDXF(DXFExport ADXFExport)
 {
     ADXFExport.AddName("MTEXT", "AcDbMText");
     ADXFExport.AddColor(this.data);
     ADXFExport.Add3DPoint(10, this.data.point);
     ADXFExport.AddFloat(40, ADXFExport.MM(this.data.height));
     if (this.data.rotation != 0f)
     {
         ADXFExport.AddFloat(50, this.data.rotation);
     }
     if (this.data.hAlign != 0)
     {
         ADXFExport.AddInt(71, this.data.hAlign + 1);
     }
     ADXFExport.current.Add("  1");
     ADXFExport.current.Add(this.data.text);
 }
Beispiel #5
0
 public override void ExportAsDXF(DXFExport ADXFExport)
 {
     if (!this.ellipse)
     {
         ADXFExport.AddName("CIRCLE", "AcDbCircle");
         ADXFExport.AddColor(this.data);
         ADXFExport.AddThickness(this.data);
         ADXFExport.Add3DPoint(10, this.data.point);
         ADXFExport.AddFloat(40, ADXFExport.MM(this.data.radius));
         return;
     }
     ADXFExport.AddName("ELLIPSE", "AcDbEllipse");
     ADXFExport.AddColor(this.data);
     ADXFExport.AddThickness(this.data);
     ADXFExport.Add3DPoint(10, this.data.point);
     ADXFExport.Add3DPoint(11, this.data.point1);
     ADXFExport.AddFloat(40, this.data.radius);
 }
Beispiel #6
0
        public override void ExportAsDXF(DXFExport ADXFExport)
        {
            switch (this.type)
            {
            case ArcType.atCircle:
            {
                ADXFExport.AddName("ARC", "AcDbCircle");
                ADXFExport.AddColor(this.data);
                ADXFExport.AddThickness(this.data);
                ADXFExport.Add3DPoint(10, this.data.point);
                ADXFExport.AddFloat(40, ADXFExport.MM(this.data.radius));
                ADXFExport.current.Add("100");
                ADXFExport.current.Add("AcDbArc");
                ADXFExport.AddFloat(50, this.data.startAngle);
                ADXFExport.AddFloat(51, this.data.endAngle);
                return;
            }

            case ArcType.atEllipse:
            {
                ADXFExport.AddName("ELLIPSE", "AcDbEllipse");
                ADXFExport.AddColor(this.data);
                ADXFExport.AddThickness(this.data);
                ADXFExport.Add3DPoint(10, this.data.point);
                ADXFExport.Add3DPoint(11, this.data.point1);
                ADXFExport.AddFloat(40, this.data.radius);
                if (Math.Abs((float)(this.data.startAngle - this.data.endAngle)) > DXFExport.accuracy)
                {
                    ADXFExport.AddFloat(41, this.data.startAngle);
                    ADXFExport.AddFloat(42, this.data.endAngle);
                }
                return;
            }

            default:
            {
                return;
            }
            }
        }
Beispiel #7
0
        private void AddPatternData(float offset, DXFExport aDXFExport)
        {
            DXFHatchPatternData[] dXFHatchPatternDataArray = new DXFHatchPatternData[2];
            int num = 1;

            dXFHatchPatternDataArray[0].basePointX = 0f;
            dXFHatchPatternDataArray[0].basePointY = 0f;
            dXFHatchPatternDataArray[0].offsetX    = -offset;
            dXFHatchPatternDataArray[0].offsetY    = offset;
            dXFHatchPatternDataArray[1].basePointX = 0f;
            dXFHatchPatternDataArray[1].basePointY = 0f;
            dXFHatchPatternDataArray[1].offsetX    = -offset;
            dXFHatchPatternDataArray[1].offsetY    = offset;
            switch (this.Style)
            {
            case HatchStyle.hsHorizontal:
            {
                dXFHatchPatternDataArray[0].angle   = 0f;
                dXFHatchPatternDataArray[0].offsetX = 0f;
                break;
            }

            case HatchStyle.hsVertical:
            {
                dXFHatchPatternDataArray[0].angle   = 90f;
                dXFHatchPatternDataArray[0].offsetY = 0f;
                break;
            }

            case HatchStyle.hsFDiagonal:
            {
                dXFHatchPatternDataArray[0].angle   = 135f;
                dXFHatchPatternDataArray[0].offsetY = -dXFHatchPatternDataArray[0].offsetY;
                break;
            }

            case HatchStyle.hsBDiagonal:
            {
                dXFHatchPatternDataArray[0].angle = 45f;
                break;
            }

            case HatchStyle.hsCross:
            {
                num = 2;
                dXFHatchPatternDataArray[0].angle   = 0f;
                dXFHatchPatternDataArray[0].offsetX = 0f;
                dXFHatchPatternDataArray[1].angle   = 90f;
                break;
            }

            case HatchStyle.hsDiagCross:
            {
                num = 2;
                dXFHatchPatternDataArray[0].angle   = 45f;
                dXFHatchPatternDataArray[1].angle   = 135f;
                dXFHatchPatternDataArray[1].offsetY = -dXFHatchPatternDataArray[0].offsetY;
                break;
            }
            }
            aDXFExport.AddFloat(52, 0f);
            aDXFExport.AddFloat(41, 1f);
            aDXFExport.AddInt(77, 0);
            aDXFExport.AddInt(78, num);
            for (int i = 0; i < num; i++)
            {
                aDXFExport.AddFloat(53, dXFHatchPatternDataArray[i].angle);
                aDXFExport.AddFloat(43, dXFHatchPatternDataArray[i].basePointX);
                aDXFExport.AddFloat(44, dXFHatchPatternDataArray[i].basePointY);
                aDXFExport.AddFloat(45, dXFHatchPatternDataArray[i].offsetX);
                aDXFExport.AddFloat(46, dXFHatchPatternDataArray[i].offsetY);
                aDXFExport.AddInt(79, 0);
            }
        }
Beispiel #8
0
        private void AddBoundaryPathData(DXFExport ADXFExport)
        {
            switch (this.boundaryType)
            {
            case HatchBoundaryType.hbtPolyPolyline:
            {
                ADXFExport.AddInt(91, this.boundaries.Count);
                for (int i = 0; i < this.boundaries.Count; i++)
                {
                    ADXFExport.AddInt(92, 1);
                    ADXFExport.AddInt(93, ((ArrayList)this.boundaries[i]).Count);
                    for (int j = 1; j < ((ArrayList)this.boundaries[i]).Count; j++)
                    {
                        ADXFExport.AddInt(72, 1);
                        ADXFExport.Add3DPoint(10, (DXFPoint)((ArrayList)this.boundaries[i])[j - 1]);
                        ADXFExport.Add3DPoint(11, (DXFPoint)((ArrayList)this.boundaries[i])[j]);
                    }
                    ADXFExport.AddInt(72, 1);
                    ADXFExport.Add3DPoint(10,
                                          (DXFPoint)((ArrayList)this.boundaries[i])[((ArrayList)this.boundaries[i]).Count - 1]);
                    ADXFExport.Add3DPoint(11, (DXFPoint)((ArrayList)this.boundaries[i])[0]);
                    ADXFExport.AddInt(97, 0);
                }
                return;
            }

            case HatchBoundaryType.hbtCircle:
            {
                ADXFExport.AddInt(91, 1);
                ADXFExport.AddInt(92, 1);
                ADXFExport.AddInt(93, 1);
                ADXFExport.AddInt(72, 2);
                ADXFExport.Add3DPoint(10, this.data.point);
                ADXFExport.AddFloat(40, ADXFExport.MM(this.data.radius));
                ADXFExport.AddFloat(50, this.data.startAngle);
                ADXFExport.AddFloat(51, this.data.endAngle);
                ADXFExport.AddInt(73, 1);
                ADXFExport.AddInt(97, 0);
                return;
            }

            case HatchBoundaryType.hbtEllipse:
            {
                ADXFExport.AddInt(91, 1);
                ADXFExport.AddInt(92, 1);
                ADXFExport.AddInt(93, 1);
                ADXFExport.AddInt(72, 3);
                ADXFExport.Add3DPoint(10, this.data.point);
                ADXFExport.Add3DPoint(11, this.data.point1);
                ADXFExport.AddFloat(40, this.data.radius);
                ADXFExport.AddFloat(50, this.data.startAngle);
                ADXFExport.AddFloat(51, this.data.endAngle);
                ADXFExport.AddInt(73, 1);
                ADXFExport.AddInt(97, 0);
                return;
            }

            default:
            {
                return;
            }
            }
        }