- // create BBTree structure
- // - get bounding boxes
- std::vector<double> bboxes(6*numSrcElems);
- std::unique_ptr<ConnType[]> srcElemIdx{ new ConnType[numSrcElems] };
- for(ConnType i = 0; i < numSrcElems ; ++i)
- {
- // get source bboxes in right order
- const BoundingBox* box = srcElems[i]->getBoundingBox();
- bboxes[6*i+0] = box->getCoordinate(BoundingBox::XMIN);
- bboxes[6*i+1] = box->getCoordinate(BoundingBox::XMAX);
- bboxes[6*i+2] = box->getCoordinate(BoundingBox::YMIN);
- bboxes[6*i+3] = box->getCoordinate(BoundingBox::YMAX);
- bboxes[6*i+4] = box->getCoordinate(BoundingBox::ZMIN);
- bboxes[6*i+5] = box->getCoordinate(BoundingBox::ZMAX);
-
- srcElemIdx[i] = srcElems[i]->getIndex();
- }
-
- adjustBoundingBoxes(bboxes);
- const double *bboxPtr = nullptr;
- if(numSrcElems>0)
- bboxPtr=bboxes.data();
- BBTree<3,ConnType> tree(bboxPtr, srcElemIdx.get(), 0, numSrcElems);
+ BBTreeStandAlone<3,ConnType> tree( BuildBBTreeWithAdjustment(srcMesh,[this](double *bbox, typename MyMeshType::MyConnType sz){ this->adjustBoundingBoxes(bbox,sz); }) );