Example #1
0
        private void triangulationMenuItem1_Click_1(object sender, System.EventArgs e)
        {
            HighQualityTriangulator triangulator = new HighQualityTriangulator(this.FirstPolygon, this.SecondPolygon);

            triangulator.Triangulation();

            this.LeftPolygon.ApplyGhostTriangles(triangulator.GhostTriangle);
            this.RightPolygon.ApplyGhostTriangles(triangulator.GhostTriangle);

            this.Invalidate();
        }
Example #2
0
        private void Triangulation()
        {
            Debug.Assert(this.CanTriangulate());

            if (StatusController.Triangulator == TriangulationTech.Simple)
            {
                Polygon2DTriangulator Triangulator = new Polygon2DTriangulator(LeftPolygon, RightPolygon);
                Triangulator.CompatibleTriangulation();
            }
            else if(StatusController.Triangulator == TriangulationTech.HighQuelity)
            {
                HighQualityTriangulator triangulator = new HighQualityTriangulator(this.FirstPolygon, this.SecondPolygon);

                triangulator.FastTriangluation();
                this.LeftPolygon.ApplyGhostTriangles(triangulator.GhostTriangle);
                this.RightPolygon.ApplyGhostTriangles(triangulator.GhostTriangle);
            }
            else
            {
                if(StatusController.availablePartition == Partition.Left)
                {
                    LeftPolygon.Triangulation();
                }
                else
                {
                    RightPolygon.Triangulation();
                }
            }
            StatusController.canAddPoint = false;
            this.toolBar1.Buttons[3].Enabled = false;
            this.Invalidate();
        }