예제 #1
0
파일: Decomposer.cs 프로젝트: prepare/box2c
        public static PolyParser LoadFromStream(Stream stream)
        {
            var x = new PolyParser(stream);

            x.Parse();
            return(x);
        }
예제 #2
0
파일: Decomposer.cs 프로젝트: prepare/box2c
        public static PolyParser LoadFromFile(string fileName)
        {
            var x = new PolyParser(fileName);

            x.Parse();
            return(x);
        }
예제 #3
0
파일: Decomposer.cs 프로젝트: prepare/box2c
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Filter = "Polygons|*.poly";

                if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    polygon = PolyParser.LoadFromFile(ofd.FileName);
                    pictureBox1.Invalidate();
                }
                else
                {
                    return;
                }
            }

            label2.Text = "Vertices: " + polygon.VertCount.ToString();
        }
예제 #4
0
 public static PolyParser LoadFromStream(Stream stream)
 {
     var x = new PolyParser(stream);
     x.Parse();
     return x;
 }
예제 #5
0
 public static PolyParser LoadFromFile(string fileName)
 {
     var x = new PolyParser(fileName);
     x.Parse();
     return x;
 }
예제 #6
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Filter = "Polygons|*.poly";

                if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    polygon = PolyParser.LoadFromFile(ofd.FileName);
                    pictureBox1.Invalidate();
                }
                else
                    return;
            }

            label2.Text = "Vertices: " + polygon.VertCount.ToString();
        }