/// <summary> /// 円のDXF情報を出力 /// </summary> public override string Print() { var content = new List <KeyValuePair <int, string> >(); content.Add(new KeyValuePair <int, string>(0, "CIRCLE")); content.Add(new KeyValuePair <int, string>(8, "0")); content.Add(new KeyValuePair <int, string>(10, Center.x.ToString())); content.Add(new KeyValuePair <int, string>(20, Center.y.ToString())); content.Add(new KeyValuePair <int, string>(30, Center.z.ToString())); content.Add(new KeyValuePair <int, string>(40, Radius.ToString())); return(DXF.ParamToString(content)); }
public void パラメーターを渡してDXF形式になっているか() { var param = new List <KeyValuePair <int, string> >(); param.Add(new KeyValuePair <int, string>(0, "SECTION")); param.Add(new KeyValuePair <int, string>(2, "HEADER")); param.Add(new KeyValuePair <int, string>(0, "ENDSEC")); param.Add(new KeyValuePair <int, string>(0, "SECTION")); param.Add(new KeyValuePair <int, string>(2, "ENTITIES")); param.Add(new KeyValuePair <int, string>(0, "ENDSEC")); param.Add(new KeyValuePair <int, string>(0, "EOF")); StreamReader sr = new StreamReader("Resource/DXF/DxfMin.dxf"); string except = sr.ReadToEnd(); string actual = DXF.ParamToString(param); sr.Close(); Assert.AreEqual(except, actual, true); }
public override string Print() { var content = new List <KeyValuePair <int, string> >(); content.Add(new KeyValuePair <int, string>(0, "POLYLINE")); content.Add(new KeyValuePair <int, string>(8, "0")); content.Add(new KeyValuePair <int, string>(66, "1")); content.Add(new KeyValuePair <int, string>(70, "1")); Points.ForEach(pos => { content.Add(new KeyValuePair <int, string>(0, "VERTEX")); content.Add(new KeyValuePair <int, string>(8, "0")); content.Add(new KeyValuePair <int, string>(10, pos.x.ToString())); content.Add(new KeyValuePair <int, string>(20, pos.y.ToString())); content.Add(new KeyValuePair <int, string>(30, pos.z.ToString())); }); content.Add(new KeyValuePair <int, string>(0, "SEQEND")); content.Add(new KeyValuePair <int, string>(8, "0")); return(DXF.ParamToString(content)); }