moab
|
Public Member Functions | |
Bucket () | |
Bucket (const Bucket &f) | |
Bucket (const unsigned int sz) | |
Bucket & | operator= (const Bucket &f) |
Static Public Member Functions | |
static unsigned int | bucket_index (int num_splits, const BoundBox &box, const BoundBox &interval, const unsigned int dim) |
Public Attributes | |
unsigned int | mySize |
BoundBox | boundingBox |
Definition at line 176 of file BVHTree.hpp.
moab::BVHTree::Bucket::Bucket | ( | ) | [inline] |
Definition at line 178 of file BVHTree.hpp.
: mySize(0) {}
moab::BVHTree::Bucket::Bucket | ( | const Bucket & | f | ) | [inline] |
Definition at line 179 of file BVHTree.hpp.
: mySize(f.mySize), boundingBox(f.boundingBox) {}
moab::BVHTree::Bucket::Bucket | ( | const unsigned int | sz | ) | [inline] |
Definition at line 180 of file BVHTree.hpp.
: mySize(sz) {}
unsigned int moab::BVHTree::Bucket::bucket_index | ( | int | num_splits, |
const BoundBox & | box, | ||
const BoundBox & | interval, | ||
const unsigned int | dim | ||
) | [inline, static] |
Definition at line 281 of file BVHTree.hpp.
{ //see FastMemoryEfficientCellLocationinUnstructuredGridsForVisualization.pdf //around page 9 //Paper arithmetic is over-optimized.. this is safer. const double min = interval.bMin[dim]; const double length = (interval.bMax[dim]-min)/(num_splits+1); const double center = ((box.bMax[dim] + box.bMin[dim])/2.0)-min; #ifndef NDEBUG #ifdef BVH_SHOW_INDEX std::cout << "[" << min << " , " << interval.max[dim] << " ]" <<std::endl; std::cout << "[" << box.bMin[dim] << " , " << box.bMax[dim] << " ]" <<std::endl; std::cout << "Length of bucket" << length << std::endl; std::cout << "Center: " << (box.bMax[dim] + box.bMin[dim])/2.0 << std::endl; std::cout << "Distance of center from min: " << center << std::endl; std::cout << "ratio: " << center/length << std::endl; std::cout << "index: " << std::ceil(center/length)-1 << std::endl; #endif #endif unsigned int cl = std::ceil(center/length); return (cl > 0 ? cl-1 : 0); }
Definition at line 184 of file BVHTree.hpp.
{ boundingBox = f.boundingBox; mySize = f.mySize; return *this; }
Definition at line 183 of file BVHTree.hpp.
unsigned int moab::BVHTree::Bucket::mySize |
Definition at line 182 of file BVHTree.hpp.