[MOAB-dev] r4014 - in MOAB/trunk: src src/moab tools/dagmc

sjackson at cae.wisc.edu sjackson at cae.wisc.edu
Mon Jun 21 15:48:31 CDT 2010


Author: sjackson
Date: 2010-06-21 15:48:31 -0500 (Mon, 21 Jun 2010)
New Revision: 4014

Modified:
   MOAB/trunk/src/OrientedBoxTreeTool.cpp
   MOAB/trunk/src/moab/OrientedBoxTreeTool.hpp
   MOAB/trunk/tools/dagmc/ray_fire_test.cc
Log:
As part of OBBTree traversal statistics, count the number of ray-
triangle intersection tests that are performed within the
OrientedBoxTreeTool.

Also record this data from DagMC's ray_fire_test.

Modified: MOAB/trunk/src/OrientedBoxTreeTool.cpp
===================================================================
--- MOAB/trunk/src/OrientedBoxTreeTool.cpp	2010-06-21 15:55:57 UTC (rev 4013)
+++ MOAB/trunk/src/OrientedBoxTreeTool.cpp	2010-06-21 20:48:31 UTC (rev 4014)
@@ -676,6 +676,7 @@
     const double tol;
     Range& boxes;
     
+
   public:
     RayIntersector( OrientedBoxTreeTool* tool_ptr,
                     const double* ray_point,
@@ -713,7 +714,8 @@
                           double tolerance,
                           const double ray_point[3],
                           const double unit_ray_dir[3],
-                          const double* ray_length )
+                          const double* ray_length, 
+                          unsigned int* raytri_test_count )
 {
   ErrorCode rval;
   intersection_distances_out.clear();
@@ -761,6 +763,8 @@
       if (MB_SUCCESS != rval)
         return rval;
       
+      if( raytri_test_count ) *raytri_test_count += 1; 
+
       double td;
       if (GeomUtil::ray_tri_intersect( coords, point, dir, tolerance, td, ray_length ))
         intersection_distances_out.push_back(td);
@@ -786,7 +790,9 @@
   if (MB_SUCCESS != rval)
     return rval;
     
-  return ray_intersect_triangles( intersection_distances_out, boxes, tolerance, ray_point, unit_ray_dir, ray_length );
+  return ray_intersect_triangles( intersection_distances_out, boxes, 
+                                  tolerance, ray_point, unit_ray_dir, ray_length, 
+                                  accum ? &(accum->ray_tri_tests_count) : NULL );
 }
 
 ErrorCode OrientedBoxTreeTool::ray_intersect_boxes( 
@@ -837,6 +843,7 @@
     std::vector<double>& intersections;
     std::vector<EntityHandle>& sets;
     std::vector<EntityHandle>& facets;    
+    unsigned int* raytri_test_count;
 
   EntityHandle lastSet;
     int lastSetDepth;
@@ -852,12 +859,13 @@


More information about the moab-dev mailing list