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

Method GetOverlappingBuckets

Common/DataModel/vtkPointLocator.cxx:971–1009  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Internal method to find those buckets that are within distance specified only those buckets within level radiuses of ijk are returned

Source from the content-addressed store, hash-verified

969// Internal method to find those buckets that are within distance specified
970// only those buckets within level radiuses of ijk are returned
971void vtkPointLocator::GetOverlappingBuckets(
972 vtkNeighborPoints* buckets, const double x[3], const int ijk[3], double dist, int level)
973{
974 int i, j, k, nei[3], minLevel[3], maxLevel[3];
975 double xMin[3], xMax[3];
976
977 // Initialize
978 buckets->Reset();
979
980 // Determine the range of indices in each direction
981 // Determine the range of indices in each direction
982 xMin[0] = x[0] - dist;
983 xMin[1] = x[1] - dist;
984 xMin[2] = x[2] - dist;
985 xMax[0] = x[0] + dist;
986 xMax[1] = x[1] + dist;
987 xMax[2] = x[2] + dist;
988
989 this->GetBucketIndices(xMin, minLevel);
990 this->GetBucketIndices(xMax, maxLevel);
991
992 for (i = minLevel[0]; i <= maxLevel[0]; i++)
993 {
994 for (j = minLevel[1]; j <= maxLevel[1]; j++)
995 {
996 for (k = minLevel[2]; k <= maxLevel[2]; k++)
997 {
998 if (i < (ijk[0] - level) || i > (ijk[0] + level) || j < (ijk[1] - level) ||
999 j > (ijk[1] + level) || k < (ijk[2] - level) || k > (ijk[2] + level))
1000 {
1001 nei[0] = i;
1002 nei[1] = j;
1003 nei[2] = k;
1004 buckets->InsertNextPoint(nei);
1005 }
1006 }
1007 }
1008 }
1009}
1010
1011//------------------------------------------------------------------------------
1012// Internal method to find those buckets that are within distance specified

Callers 5

FindClosestPointMethod · 0.95
FindDistributedPointsMethod · 0.95
FindClosestNPointsMethod · 0.95

Calls 3

ResetMethod · 0.45
GetBucketIndicesMethod · 0.45
InsertNextPointMethod · 0.45

Tested by

no test coverage detected