| 647 | //------------------------------------------------------------------------------ |
| 648 | template <typename T> |
| 649 | vtkIdType CellTree<T>::FindCell( |
| 650 | double* pos, vtkGenericCell* cell, int& subId, double* pcoords, double* weights) |
| 651 | { |
| 652 | // check if pos outside of bounds |
| 653 | if (!this->Locator->IsInBounds(this->DataBBox, pos)) |
| 654 | { |
| 655 | return -1; |
| 656 | } |
| 657 | |
| 658 | double dist2; |
| 659 | |
| 660 | CellPointTraversal<T> pt(*this, pos); |
| 661 | while (const TCellTreeNode* n = pt.Next()) |
| 662 | { |
| 663 | const T* begin = &(this->Leaves[n->Start()]); |
| 664 | const T* end = begin + n->Size(); |
| 665 | |
| 666 | for (; begin != end; ++begin) |
| 667 | { |
| 668 | if (this->Locator->InsideCellBounds(pos, *begin)) |
| 669 | { |
| 670 | this->DataSet->GetCell(*begin, cell); |
| 671 | if (cell->EvaluatePosition(pos, nullptr, subId, pcoords, dist2, weights) == 1) |
| 672 | { |
| 673 | return *begin; |
| 674 | } |
| 675 | } |
| 676 | } |
| 677 | } |
| 678 | |
| 679 | return -1; |
| 680 | } |
| 681 | |
| 682 | //------------------------------------------------------------------------------ |
| 683 | template <typename T> |
nothing calls this directly
no test coverage detected