//private double toRadian(float degreeAngle) //{ // double radian, degree; // degree = Convert.ToDouble(degreeAngle); // radian = (degree * Math.PI) / 180; // return radian; //} private Circulo ReadCirculo(ref ParCodigoValor cod) { var circulo = new Circulo(); Vector3f centro = Vector3f.Nulo; Vector3f normal = Vector3f.UnitarioZ; //Dictionary<ApplicationRegistry, XData> xData = new Dictionary<ApplicationRegistry, XData>(); cod = this.ReadCodePair(); while (cod.Cod != 0) { switch (cod.Cod) { case 5: circulo.Handle = cod.Val; cod = this.ReadCodePair(); break; //case 8: //layer code // circle.Layer = this.GetLayer(code.Value); // code = this.ReadCodePair(); // break; //case 62: //aci color code // circle.Color = new AciColor(short.Parse(code.Value)); // code = this.ReadCodePair(); // break; //case 6: //type line code // circle.LineType = this.GetLineType(code.Value); // code = this.ReadCodePair(); // break; case 10: centro.X = float.Parse(cod.Val); cod = this.ReadCodePair(); break; case 20: centro.Y = float.Parse(cod.Val); cod = this.ReadCodePair(); break; case 30: centro.Z = float.Parse(cod.Val); cod = this.ReadCodePair(); break; case 40: circulo.Radio = float.Parse(cod.Val); cod = this.ReadCodePair(); break; //case 39: // circulo.Thickness = float.Parse(cod.Val); // cod = this.ReadCodePair(); // break; case 210: normal.X = float.Parse(cod.Val); cod = this.ReadCodePair(); break; case 220: normal.Y = float.Parse(cod.Val); cod = this.ReadCodePair(); break; case 230: normal.Z = float.Parse(cod.Val); cod = this.ReadCodePair(); break; //case 1001: // XData xDataItem = this.ReadXDataRecord(code.Value, ref code); // xData.Add(xDataItem.ApplicationRegistry, xDataItem); // break; default: if (cod.Cod >= 1000 && cod.Cod <= 1071) throw new DxfInvalidCodeValueEntityException(cod.Cod, cod.Val, this.archivo, "The extended data of an entity must start with the application registry code " + this.fileLine); cod = this.ReadCodePair(); break; } } //circulo.XData = xData; circulo.Centro = centro; circulo.Normal = normal; return circulo; }
public static List<string> Circulo(Circulo a) { G03_CirculoA mov; List<string> movs = new List<string>(); mov = new G03_CirculoA(); mov.Inicio.X = a.Inicio.X; mov.Inicio.Y = a.Inicio.Y; mov.Inicio.Z = a.Inicio.Z; mov.Radio = a.Radio; movs.Add(mov.ToString()); return movs; }