예제 #1
0
 public void MarkEdge(DelaunayTriangle triangle)
 {
     //for (int i = 0; i < 3; i++)
     //{
     //    if (EdgeIsConstrained[i])
     //    {
     //        triangle.MarkConstrainedEdge(Points[(i + 1) % 3], Points[(i + 2) % 3]);
     //    }
     //}
     if (this.C0)
     {    //(0 + 1) % 3 => 2
         //(0 + 2) % 3 => 1
         triangle.SelectAndMarkConstrainedEdge(2, 11);
     }
     if (this.C1)
     {   //(1 + 1) % 3 => 1
         //(1 + 2) % 3 => 0
         triangle.SelectAndMarkConstrainedEdge(1, 0);
     }
     if (this.C2)
     {
         //(2 + 1) % 3 => 0
         //(2 + 2) % 3 => 1
         triangle.SelectAndMarkConstrainedEdge(0, 1);
     }
 }
예제 #2
0
        /// <summary>
        /// Finalize edge marking
        /// </summary>
        public void MarkNeighborEdges()
        {
            //for (int i = 0; i < 3; i++)
            //{
            //    if (EdgeIsConstrained[i] && Neighbors[i] != null)
            //    {
            //        Neighbors[i].MarkConstrainedEdge(Points[(i + 1) % 3], Points[(i + 2) % 3]);
            //    }

            //}

            //-----------------
            //0
            if (this.C0 && N0 != null)
            {
                //(0 + 1) % 3 => 2
                //(0 + 2) % 3 => 1
                N0.SelectAndMarkConstrainedEdge(2, 1);
            }
            //-----------------
            //1
            if (this.C1 && N1 != null)
            {
                //(1 + 1) % 3 => 1
                //(1 + 2) % 3 => 0
                N1.SelectAndMarkConstrainedEdge(1, 0);
            }
            //-----------------
            //2
            if (this.C2 && N2 != null)
            {
                //(2 + 1) % 3 => 0
                //(2 + 2) % 3 => 1

                N2.SelectAndMarkConstrainedEdge(0, 1);
            }
        }