[MOAB-dev] r5926 - in MOAB/trunk: examples itaps/igeom src/moab test

iulian at mcs.anl.gov iulian at mcs.anl.gov
Tue Dec 18 12:13:29 CST 2012


Author: iulian
Date: 2012-12-18 12:13:29 -0600 (Tue, 18 Dec 2012)
New Revision: 5926

Modified:
   MOAB/trunk/examples/ObbTree.cpp
   MOAB/trunk/itaps/igeom/testSmooth2.cc
   MOAB/trunk/src/moab/SpectralMeshTool.hpp
   MOAB/trunk/test/TestUtil.hpp
Log:
eliminate more warnings
correct ObbTree example
TestUtil should compare double with double, not double with float
spectral mesh tool has an unused member data


Modified: MOAB/trunk/examples/ObbTree.cpp
===================================================================
--- MOAB/trunk/examples/ObbTree.cpp	2012-12-18 15:58:23 UTC (rev 5925)
+++ MOAB/trunk/examples/ObbTree.cpp	2012-12-18 18:13:29 UTC (rev 5926)
@@ -38,8 +38,7 @@
   }
   
   // build box
-  double box_center[3], box_axis1[3], box_axis2[3], box_axis3[3], start_pnt[3],
-    ray_length;
+  double box_center[3], box_axis1[3], box_axis2[3], box_axis3[3], pnt_start[3], ray_length;
   rval = tool.box(tree_root, box_center, box_axis1, box_axis2, box_axis3);
   if (rval != moab::MB_SUCCESS) {
     std::cerr << "Couldn't get box for tree root set.";
@@ -49,20 +48,27 @@
   ray_length = 2.*sqrt(box_axis1[0]*box_axis1[0] + box_axis1[1]*box_axis1[1] +
 		       box_axis1[2]*box_axis1[2]);
   
-  // do ray-tracing from box center to x direction
+  // do ray-tracing from box center side to x direction
   std::vector<double> intersections;
   std::vector<moab::EntityHandle> intersection_facets;
-  double dir[3] = {1., 0., 0.};
+
+  for (int i=0; i<3; i++)
+    pnt_start[i] = box_center[i]-box_axis1[i];
+
+  if (ray_length>0) // normalize ray direction
+    for (int j=0; j<3; j++)
+      box_axis1[j]=2*box_axis1[j]/ray_length;
   rval = tool.ray_intersect_triangles(intersections, intersection_facets, 
-				      tree_root, 10e-12, box_center, dir,
+				      tree_root, 10e-12, pnt_start, box_axis1,
 				      &ray_length);
   if (rval != moab::MB_SUCCESS) {
     std::cerr << "Couldn't ray tracing.";
     return 1;
   }
   
-  std::cout << "ray start point: " << start_pnt[0] << " "
-	    << start_pnt[1] << " " << start_pnt[2] << std::endl;
+  std::cout << "ray start point: " << pnt_start[0] << " "
+	    << pnt_start[1] << " " << pnt_start[2] << std::endl;
+  std::cout << " ray direction: " << box_axis1[0] << " " << box_axis1[1] << " " << box_axis1[2] << "\n";
   std::cout << "# of intersections : " << intersections.size() << std::endl;
   std::cout << "intersection distances are on";
   for (unsigned int i = 0; i < intersections.size(); i++) {

Modified: MOAB/trunk/itaps/igeom/testSmooth2.cc
===================================================================
--- MOAB/trunk/itaps/igeom/testSmooth2.cc	2012-12-18 15:58:23 UTC (rev 5925)


More information about the moab-dev mailing list