Ejemplo n.º 1
0
        private void divideMenuItem_Click_1(object sender, System.EventArgs e)
        {
            TriangleDiviser triangleDiviser = new TriangleDiviser(this.FirstPolygon, this.SecondPolygon);

            triangleDiviser.Divide(this.LeftPolygon.GhostTriangles);

            this.Invalidate();
        }
Ejemplo n.º 2
0
        private void Divide()
        {
            Polygon2DAdorner leftPolygon = this.LeftPolygon;
            Polygon2DAdorner rightPolygon = this.RightPolygon;

            while (leftPolygon != null)
            {
                if (StatusController.Triangulator != TriangulationTech.Single)
                {
                    TriangleDiviser triangleDiviser = new TriangleDiviser(leftPolygon.polygon, rightPolygon.polygon);

                    triangleDiviser.Divide(leftPolygon.GhostTriangles);
                }

                else if (StatusController.availablePartition == Partition.Left)
                {
                    TriangleDiviser triangleDiviser = new TriangleDiviser(leftPolygon.polygon, leftPolygon.polygon);

                    triangleDiviser.Divide(leftPolygon.GhostTriangles);
                }

                else
                {
                    TriangleDiviser triangleDiviser = new TriangleDiviser(rightPolygon.polygon, rightPolygon.polygon);

                    triangleDiviser.Divide(rightPolygon.GhostTriangles);
                }
                leftPolygon = leftPolygon.Next();
                rightPolygon = rightPolygon.Next();
            }

            this.Invalidate();
        }