| 482 | //------------------------------------------------------------------------------ |
| 483 | template <typename T> |
| 484 | vtkIdType CellProcessor<T>::FindCell( |
| 485 | const double pos[3], vtkGenericCell* cell, int& subId, double pcoords[3], double* weights) |
| 486 | { |
| 487 | // check if pos outside of bounds |
| 488 | if (!CellProcessor::IsInBounds(this->Bounds, pos)) |
| 489 | { |
| 490 | return -1; |
| 491 | } |
| 492 | vtkIdType binId = this->Binner->GetBinIndex(pos); |
| 493 | T numIds = this->GetNumberOfIds(binId); |
| 494 | |
| 495 | // Only thread the evaluation if enough cells need to be processed |
| 496 | if (numIds < 1) |
| 497 | { |
| 498 | return -1; |
| 499 | } |
| 500 | // Run through serially. A parallel implementation is possible but does |
| 501 | // not seem to be much faster. |
| 502 | else |
| 503 | { |
| 504 | const CellFragments<T>* cellIds = this->GetIds(binId); |
| 505 | double dist2; |
| 506 | T cellId; |
| 507 | |
| 508 | for (T j = 0; j < numIds; j++) |
| 509 | { |
| 510 | cellId = cellIds[j].CellId; |
| 511 | |
| 512 | if (this->InsideCellBounds(pos, cellId)) |
| 513 | { |
| 514 | this->DataSet->GetCell(cellId, cell); |
| 515 | if (cell->EvaluatePosition(pos, nullptr, subId, pcoords, dist2, weights) == 1) |
| 516 | { |
| 517 | return cellId; |
| 518 | } |
| 519 | } // in bounding box |
| 520 | } // for cells in this bin |
| 521 | |
| 522 | return -1; // nothing found |
| 523 | } // serial |
| 524 | } |
| 525 | |
| 526 | //------------------------------------------------------------------------------ |
| 527 | template <typename T> |
nothing calls this directly
no test coverage detected