private void открытьToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { circles.Clear(); StreamReader sr = new StreamReader(ofd.FileName); while (!sr.EndOfStream) { String[] g = sr.ReadLine().Split(' '); Circle circle = new Circle() { R = double.Parse(g[0]), X = double.Parse(g[1]), Y = double.Parse(g[2]) }; circles.Add(circle); } sr.Close(); vd = new VD<Circle, DeloneCircle>(circles[0], circles[1], null); for (int i = 2; i < circles.Count; i++) vd.Insert(circles[i]); Invalidate(); } }
private void OpenCommand_Execute(object sender, ExecutedRoutedEventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == true) { ellipses.Clear(); StreamReader sr = new StreamReader(ofd.FileName); while (!sr.EndOfStream) { String[] g = sr.ReadLine().Split(' '); Circle circle = new Circle() { R = double.Parse(g[0]), X = double.Parse(g[1]), Y = double.Parse(g[2]) }; ellipses.Add(circle); } sr.Close(); vd = new VD<Circle, DeloneCircle>(ellipses[0], ellipses[1], null); for (int i = 2; i < ellipses.Count; i++) vd.Insert(ellipses[i]); if (vd != null) BuildTriples(vd.NextTriple(vd.NullTriple), gg_triples, true); else gg_triples.Children.Clear(); triple = vd.NextTriple(vd.NullTriple); } }