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

Method FindChildIndex

Common/DataModel/vtkHyperTreeGridGeometricLocator.cxx:560–578  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

558
559//------------------------------------------------------------------------------
560vtkIdType vtkHyperTreeGridGeometricLocator::FindChildIndex(
561 unsigned int dim, unsigned int bf, const double normalizedPt[3]) const
562{
563 std::vector<int> binPt(dim, -1);
564 for (unsigned int d = 0; d < dim; d++)
565 {
566 binPt[d] = std::distance(this->Bins1D.begin(),
567 std::upper_bound(this->Bins1D.begin(), this->Bins1D.end(), normalizedPt[d]));
568 }
569
570 // convert tuple index to single index
571 vtkIdType childIndex = 0;
572 for (unsigned int d = 0; d < dim; d++)
573 {
574 childIndex *= bf;
575 childIndex += binPt[dim - d - 1];
576 }
577 return childIndex;
578}
579
580//------------------------------------------------------------------------------
581bool vtkHyperTreeGridGeometricLocator::CheckLeafOrChildrenMasked(

Callers 1

RecursiveSearchMethod · 0.95

Calls 3

distanceFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected