public override long ParseFigure(DxfReader reader) { bool error = false; Console.WriteLine("Parsing POINT..."); DxfReader tempReader = DxfReader.Clone(reader); Dictionary <string, double> pointDictionary = new Dictionary <string, double>() { { "10", 0 }, // x1 { "20", 0 }, // y1 }; pointDictionary = Figure.Parser(tempReader, pointDictionary, out error); Point.Create(pointDictionary["10"], pointDictionary["20"], error); return(tempReader.Counter - 2); // тут seek лучше прикрутить }
public override long ParseFigure(DxfReader reader) { Console.WriteLine("Parsing CIRCLE..."); bool error; DxfReader tempReader = DxfReader.Clone(reader); Dictionary <string, double> circleDictionary = new Dictionary <string, double>() { { "10", 0 }, // xCenter { "20", 0 }, // yCenter { "40", 0 } // radius }; circleDictionary = Figure.Parser(tempReader, circleDictionary, out error); Circle.Create(circleDictionary["10"], circleDictionary["20"], circleDictionary["40"], error); return(tempReader.Counter - 2); // тут seek лучше прикрутить }
public override long ParseFigure(DxfReader reader) { Console.WriteLine("Parsing POLYLINE..."); bool error; DxfReader tempReader = DxfReader.Clone(reader); /* Dictionary<string, double> polyLineDictionary = new Dictionary<string, double>() * { * { "90", 0 } // points' number * // { "10", 0 }, // points' x * // { "20", 0 }, // point' y * }; * // создать указанное "90" точек и таскать перо между ними без подъема */ for (;;) { } return(tempReader.Counter - 2); }
public override long ParseFigure(DxfReader reader) { bool error = false; Console.WriteLine("Parsing LINE..."); DxfReader tempReader = DxfReader.Clone(reader); Dictionary <string, double> lineDictionary = new Dictionary <string, double>() { { "10", 0 }, // x1 { "11", 0 }, // x2 { "20", 0 }, // y1 { "21", 0 } // y2 }; lineDictionary = Figure.Parser(tempReader, lineDictionary, out error); Line.Create(lineDictionary["10"], lineDictionary["20"], lineDictionary["11"], lineDictionary["21"], error); return(tempReader.Counter - 2); // тут seek лучше прикрутить }
public override long ParseFigure(DxfReader reader) { Console.WriteLine("Parsing ARC..."); bool error; DxfReader tempReader = DxfReader.Clone(reader); Dictionary <string, double> arcDictionary = new Dictionary <string, double>() { { "10", 0 }, // xCenter { "20", 0 }, // yCenter { "40", 0 }, // radius { "50", 0 }, // angleStart { "51", 0 } // angleStop }; arcDictionary = Figure.Parser(tempReader, arcDictionary, out error); Arc.Create(arcDictionary["10"], arcDictionary["20"], arcDictionary["40"], arcDictionary["50"], arcDictionary["51"], error); return(tempReader.Counter - 2); // тут seek лучше прикрутить }