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

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


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

Modified:
   MOAB/trunk/src/moab/point_locater/element_tree.hpp
   MOAB/trunk/tools/point_search.cpp
Log:
bounding boxes

Modified: MOAB/trunk/src/moab/point_locater/element_tree.hpp
===================================================================
--- MOAB/trunk/src/moab/point_locater/element_tree.hpp	2012-08-03 18:37:16 UTC (rev 5658)
+++ MOAB/trunk/src/moab/point_locater/element_tree.hpp	2012-08-03 18:37:17 UTC (rev 5659)
@@ -19,6 +19,20 @@
 namespace moab {
 //forward declarations
 
+
+struct Box{
+	typedef typename std::vector< double> Vector;
+	Box(): max(3,0.0), min(3,0.0){}
+	Box( const Vector & max_, const Vector & min_): max(max_), min(min_){}
+	Box( const Box & from): max( from.max), min( from.min){}
+	Vector max;
+	Vector min;
+}; //Box
+
+
+
+
+
 template< typename _Entity_handles, 
 	  typename _Boxes, 
 	  typename _Moab> class Element_tree;
@@ -88,7 +102,7 @@
 	bool operator()( const Iterator a, const Iterator b){
 		return (*a).first < (*b).first;
 	}
-}; // Element_compae
+}; // Element_compare
 
 
 
@@ -113,8 +127,8 @@
 			      _Boxes, 
 			      _Moab> Self; 
 	typedef typename _element_tree::Node< Entity_handles> Node;
-	typedef typename Boxes::value_type Box;
-	typedef typename std::pair< Box, std::size_t> Data;
+	typedef typename std::pair< typename Boxes::value_type, 
+				    std::size_t> Data;
 	typedef typename Entity_handles::value_type Entity_handle;
 	//TODO: we really want an unordered map here..
 	typedef typename std::map< Entity_handle, Data> Entity_map;
@@ -135,7 +149,7 @@
 		elements[ ++index] = i;
 	}
 	//We only build nonempty trees
-	if( entity_handles_.size()){ 
+	if( elements.size()){ 


More information about the moab-dev mailing list