Ejemplo n.º 1
0
        //How many points does the input triangle share with this triangle;
        public virtual List <int> GetCommonPointIndexList(EPMShape s2)
        {
            List <int> commonIndexList = new List <int>();
            int        p1, p2;

            p1 = p2 = 0;
            while (p1 < g_sortedIndexList.Count && p2 < s2.g_sortedIndexList.Count)
            {
                if (g_sortedIndexList[p1] < s2.g_sortedIndexList[p2])
                {
                    p1++;
                }
                else if (g_sortedIndexList[p1] > s2.g_sortedIndexList[p2])
                {
                    p2++;
                }
                else
                {
                    commonIndexList.Add(g_sortedIndexList[p1]);
                    p1++;
                    p2++;
                }
            }
            return(commonIndexList);
        }
Ejemplo n.º 2
0
        public virtual List <int> GetUnCommonPointIndexList(EPMShape s2, bool countS2In = false)
        {
            List <int> unCommonIndexList = new List <int>();
            int        p1, p2;

            p1 = p2 = 0;
            while (p1 < g_sortedIndexList.Count && p2 < s2.g_sortedIndexList.Count)
            {
                if (g_sortedIndexList[p1] < s2.g_sortedIndexList[p2])
                {
                    unCommonIndexList.Add(g_sortedIndexList[p1]);
                    p1++;
                }
                else if (g_sortedIndexList[p1] > s2.g_sortedIndexList[p2])
                {
                    if (countS2In)
                    {
                        unCommonIndexList.Add(s2.g_sortedIndexList[p2]);
                    }
                    p2++;
                }
                else
                {
                    p1++;
                    p2++;
                }
            }
            return(unCommonIndexList);
        }
Ejemplo n.º 3
0
 public override bool EqualTo(EPMShape shape)
 {
     //For Triangle, the long hash can represent 1,000,000 different triangles, I think it is enough for mesh generating.
     if (GetLongHash() != shape.GetLongHash())
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 4
0
 public virtual bool EqualTo(EPMShape shape)
 {
     if (GetLongHash() != shape.GetLongHash())
     {
         return(false);
     }
     if (g_sortedIndexList.Count != shape.g_sortedIndexList.Count)
     {
         return(false);
     }
     for (int i = 0; i < g_sortedIndexList.Count; i++)
     {
         if (g_sortedIndexList[i] != shape.g_sortedIndexList[i])
         {
             return(false);
         }
     }
     return(true);
 }