Esempio n. 1
0
        public override void ParseToLines(ArrayList NewElemes)
        {
            DXFLine dXFLine = new DXFLine();

            dXFLine.StartPoint.X = this.data.point1.X;
            dXFLine.StartPoint.Y = this.data.point.Y;
            dXFLine.EndPoint.X   = this.data.point.X;
            dXFLine.EndPoint.Y   = this.data.point.Y;
            NewElemes.Add(dXFLine.Clone());
            dXFLine.StartPoint.X = this.data.point.X;
            dXFLine.StartPoint.Y = this.data.point.Y;
            dXFLine.EndPoint.X   = this.data.point.X;
            dXFLine.EndPoint.Y   = this.data.point1.Y;
            NewElemes.Add(dXFLine.Clone());
            dXFLine.StartPoint.X = this.data.point.X;
            dXFLine.StartPoint.Y = this.data.point1.Y;
            dXFLine.EndPoint.X   = this.data.point1.X;
            dXFLine.EndPoint.Y   = this.data.point1.Y;
            NewElemes.Add(dXFLine.Clone());
            dXFLine.StartPoint.X = this.data.point1.X;
            dXFLine.StartPoint.Y = this.data.point1.Y;
            dXFLine.EndPoint.X   = this.data.point1.X;
            dXFLine.EndPoint.Y   = this.data.point.Y;
            NewElemes.Add(dXFLine.Clone());
        }
Esempio n. 2
0
        public object Clone()
        {
            DXFLine dXFLine = new DXFLine()
            {
                StartPoint = (DXFPoint)this.StartPoint.Clone(),
                EndPoint   = (DXFPoint)this.EndPoint.Clone()
            };

            return(dXFLine);
        }
Esempio n. 3
0
        public override void ParseToLines(ArrayList NewElemes)
        {
            float    single;
            float    single1;
            DXFPoint dXFPoint = new DXFPoint();
            DXFLine  dXFLine  = new DXFLine();
            float    x        = this.data.point.X;
            float    y        = this.data.point.Y;

            if (this.ellipse)
            {
                single  = Math.Abs(this.data.point1.X);
                single1 = Math.Abs(this.data.point1.Y);
                if (single == 0f)
                {
                    single = single1 * this.data.radius;
                }
                if (single1 == 0f)
                {
                    single1 = single * this.data.radius;
                }
            }
            else
            {
                single  = this.data.radius;
                single1 = single;
            }
            float single2 = this.data.startAngle * 3.141593f / 180f;
            float single3 = this.data.endAngle * 3.141593f / 180f;
            int   num     = (int)Math.Round((double)((single3 - single2) / 3.141593f * 16f));

            if (num < 4)
            {
                num = 4;
            }
            float single4 = (single3 - single2) / (float)(num - 1);

            for (int i = 0; i < num - 2; i++)
            {
                dXFLine.Layer = base.Layer;
                float single5 = (float)Math.Sin((double)single2);
                float single6 = (float)Math.Cos((double)single2);
                dXFPoint.X         = x + single * single6;
                dXFPoint.Y         = y + single1 * single5;
                dXFLine.StartPoint = (DXFPoint)dXFPoint.Clone();
                single2            = single2 + single4;
                single5            = (float)Math.Sin((double)single2);
                single6            = (float)Math.Cos((double)single2);
                dXFPoint.X         = x + single * single6;
                dXFPoint.Y         = y + single1 * single5;
                dXFLine.EndPoint   = (DXFPoint)dXFPoint.Clone();
                NewElemes.Add(dXFLine.Clone());
            }
        }
Esempio n. 4
0
        public override void ParseToLines(ArrayList NewElemes)
        {
            DXFLine dXFLine = new DXFLine(this.data);

            for (int i = 0; i < this.PointCount - 1; i++)
            {
                dXFLine.Layer      = base.Layer;
                dXFLine.StartPoint = (DXFPoint)this.GetPoint(i).Clone();
                if (i >= this.PointCount - 1)
                {
                    dXFLine.EndPoint = (DXFPoint)this.GetPoint(0).Clone();
                }
                else
                {
                    dXFLine.EndPoint = (DXFPoint)this.GetPoint(i + 1).Clone();
                }
                NewElemes.Add(dXFLine.Clone());
            }
        }