Beispiel #1
0
 public void FindIntersectionCandidates(TopoTriangle triangle, HashSet <TopoTriangle> resultList)
 {
     if (triangles != null) // end leaf, test all boxes for intersection
     {
         foreach (TopoTriangle test in triangles)
         {
             if (test != triangle && test.boundingBox.IntersectsBox(triangle.boundingBox))
             {
                 resultList.Add(test);
             }
         }
         return;
     }
     if (left == null)
     {
         return;
     }
     if (triangle.boundingBox.minPoint[dimension] < middlePosition)
     {
         left.FindIntersectionCandidates(triangle, resultList);
     }
     if (triangle.boundingBox.maxPoint[dimension] > middlePosition)
     {
         right.FindIntersectionCandidates(triangle, resultList);
     }
     if (triangle.boundingBox.minPoint[dimension] < middlePosition && triangle.boundingBox.maxPoint[dimension] > middlePosition)
     {
         middle.FindIntersectionCandidates(triangle, resultList);
     }
 }
Beispiel #2
0
        public HashSet <TopoTriangle> FindIntersectionCandidates(TopoTriangle triangle)
        {
            if (tree == null)
            {
                PrepareFastSearch();
            }
            HashSet <TopoTriangle> result = new HashSet <TopoTriangle>();

            tree.FindIntersectionCandidates(triangle, result);
            return(result);
        }