Пример #1
0
        private void delaunay2DToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Viewport2D viewport = new Viewport2D();

            viewport.Show(dockPanel1, DockState.Document);

            // start the graphic engine
            StartGraphicEngine();

            // init  a local delaunay
            DelaunayCS delaunay = new DelaunayCS();

            // add a random points  TODO: add external source (ex. file)
            delaunay.CreateRandomPoints(10000, new FxVector2f(0, 0), new FxVector2f(10000, 10000));

            // init the shader part of delaunay
            delaunay.InitShaders(Engine.g_device);

            // show the points
            delaunay.DrawPoints(viewport.canvas);

            // run the algorithm
            delaunay.RunTheAlgorithm(viewport.canvas);

            // show the triangles
            delaunay.DrawTriangles(viewport.canvas);
        }
Пример #2
0
        private void add2DViewportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // create a new viewport
            Viewport2D viewport = new Viewport2D();

            // add the viewport to the dock
            viewport.Show(dockPanel1, DockState.Document);
        }