MCPcopy Create free account
hub / github.com/Kitware/VTK / FindCell

Method FindCell

Common/DataModel/vtkCellTreeLocator.cxx:649–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

647//------------------------------------------------------------------------------
648template <typename T>
649vtkIdType 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//------------------------------------------------------------------------------
683template <typename T>

Callers

nothing calls this directly

Calls 8

BuildLocatorMethod · 0.95
IsInBoundsMethod · 0.45
NextMethod · 0.45
StartMethod · 0.45
SizeMethod · 0.45
InsideCellBoundsMethod · 0.45
GetCellMethod · 0.45
EvaluatePositionMethod · 0.45

Tested by

no test coverage detected