93 const double iter_tol = 1.0e-10,
94 const double inside_tol = 1.0e-6,
95 bool* multiple_leaves = NULL,
115 const double distance,
116 std::vector< EntityHandle >& result_list,
117 const double iter_tol = 1.0e-10,
118 const double inside_tol = 1.0e-6,
119 std::vector< double >* result_dists = NULL,
120 std::vector< CartVect >* result_params = NULL,
145 :
dim( UINT_MAX ),
nl( UINT_MAX ),
nr( UINT_MAX ),
split( DBL_MAX ),
Lmax( -DBL_MAX ),
Rmin( DBL_MAX )
214 const unsigned int dim );
275 HandleDataVec::const_iterator end,
277 std::vector< std::vector< Bucket > >& buckets )
const;
280 std::vector< Bucket >::const_iterator begin,
281 std::vector< Bucket >::const_iterator end )
const;
284 const std::vector< std::vector< Bucket > >& buckets,
285 const SplitData& data )
const;
287 void order_elements( HandleDataVec::iterator& begin, HandleDataVec::iterator& end, SplitData& data )
const;
289 void median_order( HandleDataVec::iterator& begin, HandleDataVec::iterator& end, SplitData& data )
const;
291 void choose_best_split(
const std::vector< std::vector< SplitData > >& splits, SplitData& data )
const;
293 void find_split( HandleDataVec::iterator& begin, HandleDataVec::iterator& end, SplitData& data )
const;
296 const unsigned int& index,
297 const double iter_tol,
298 const double inside_tol,
299 std::pair< EntityHandle, CartVect >& result );
302 const double iter_tol = 1.0e-10,
303 const double inside_tol = 1.0e-6 );
306 HandleDataVec::iterator begin,
307 HandleDataVec::iterator end,
310 const int depth = 0 );
314 const Range& elements,
333 const unsigned int dim )
339 const double min = interval.
bMin[
dim];
340 const double length = ( interval.
bMax[
dim] - min ) / ( num_splits + 1 );
343 #ifdef BVH_SHOW_INDEX
344 std::cout <<
"[" << min <<
" , " << interval.max[
dim] <<
" ]" << std::endl;
345 std::cout <<
"[" << box.
bMin[
dim] <<
" , " << box.
bMax[
dim] <<
" ]" << std::endl;
346 std::cout <<
"Length of bucket" <<
length << std::endl;
347 std::cout <<
"Center: " << ( box.
bMax[
dim] + box.
bMin[
dim] ) / 2.0 << std::endl;
348 std::cout <<
"Distance of center from min: " <<
center << std::endl;
350 std::cout <<
"index: " << std::ceil(
center /
length ) - 1 << std::endl;
354 return ( cl > 0 ? cl - 1 : 0 );
363 std::vector< Bucket >::const_iterator begin,
364 std::vector< Bucket >::const_iterator end )
const
367 unsigned int count = 0;
368 for( std::vector< Bucket >::const_iterator b = begin; b != end; ++b )
370 const BoundBox& box = b->boundingBox;
387 HandleDataVec::iterator& end,
390 for( HandleDataVec::iterator i = begin; i != end; ++i )
393 i->myDim = ( index <= data.
split ) ? 0 : 1;
400 std::vector< SplitData > best_splits;
401 for( std::vector< std::vector< SplitData > >::const_iterator i = splits.begin(); i != splits.end(); ++i )
403 std::vector< SplitData >::const_iterator j =
405 best_splits.push_back( *j );
407 data = *std::min_element( best_splits.begin(), best_splits.end(),
Split_comparator() );
411 const Range& elements,
417 std::vector< EntityHandle > storage;
428 for(
int j = 0; j < num_conn; j++ )
429 box.
update( &coordinate[3 * j] );
430 if( i == elements.
begin() )
434 handle_data_vec.push_back(
HandleData( *i, box, 0.0 ) );