[MOAB-dev] r5670 - in MOAB/trunk: src/moab/point_locater tools

rhl6856 at mcs.anl.gov rhl6856 at mcs.anl.gov
Fri Aug 3 13:37:27 CDT 2012


Author: rhl6856
Date: 2012-08-03 13:37:26 -0500 (Fri, 03 Aug 2012)
New Revision: 5670

Modified:
   MOAB/trunk/src/moab/point_locater/bvh_tree.hpp
   MOAB/trunk/src/moab/point_locater/common_tree.hpp
   MOAB/trunk/src/moab/point_locater/point_locater.hpp
   MOAB/trunk/tools/point_search.cpp
Log:
bvh tree works.

Modified: MOAB/trunk/src/moab/point_locater/bvh_tree.hpp
===================================================================
--- MOAB/trunk/src/moab/point_locater/bvh_tree.hpp	2012-08-03 18:37:26 UTC (rev 5669)
+++ MOAB/trunk/src/moab/point_locater/bvh_tree.hpp	2012-08-03 18:37:26 UTC (rev 5670)
@@ -22,6 +22,9 @@
 #define BVH_TREE_DEBUG
 #ifndef BVH_TREE_HPP
 #define BVH_TREE_HPP
+
+namespace ct = moab::common_tree;
+
 namespace moab {
 
 //forward declarations
@@ -56,7 +59,7 @@
 	class Split_comparator : 
 			public std::binary_function< Split, Split, bool> {
 		inline double objective( const Split & a) const{
-			return a.Lmax*a.nl + a.Rmin*a.nr;
+			return a.Lmax*a.nl - a.Rmin*a.nr;
 		}
 		public:
 		bool operator()( const Split & a, const Split & b) const{
@@ -78,6 +81,7 @@
 
 	class _Split_data {
 		public:
+		typedef typename ct::Box< double> Box;
 		_Split_data(): dim( 0), nl( 0), nr( 0), split( 0.0), 
 				Lmax( 0.0), Rmin( 0.0),bounding_box(), 
 				left_box(), right_box(){}
@@ -91,9 +95,9 @@
 		std::size_t nr;
 		double split;
 		double Lmax, Rmin;
-		common_tree::Box< double> bounding_box;
-		common_tree::Box< double> left_box;
-		common_tree::Box< double> right_box;
+		Box bounding_box;
+		Box left_box;
+		Box right_box;
 		_Split_data& operator=( const _Split_data & f){
 			dim  	     = f.dim;
 			nl   	     = f.nl; 
@@ -116,7 +120,7 @@
 		_Bucket( const std::size_t size_): 
 		size( size_), bounding_box(){}
 		std::size_t size;
-		common_tree::Box< double> bounding_box;
+		ct::Box< double> bounding_box;
 		_Bucket& operator=( const _Bucket & f){


More information about the moab-dev mailing list