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

Method GetOverlappingBuckets

Common/DataModel/vtkStaticPointLocator2D.cxx:1387–1417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1385// only those buckets outside of level radiuses of ij are returned
1386template <typename TIds>
1387void BucketList2D<TIds>::GetOverlappingBuckets(
1388 NeighborBuckets2D* buckets, const double x[3], const int ij[2], double dist, int level)
1389{
1390 int i, j, nei[3], minLevel[2], maxLevel[2];
1391 double xMin[3], xMax[3];
1392
1393 // Initialize
1394 buckets->Reset();
1395
1396 // Determine the range of indices in each direction
1397 xMin[0] = x[0] - dist;
1398 xMin[1] = x[1] - dist;
1399 xMax[0] = x[0] + dist;
1400 xMax[1] = x[1] + dist;
1401
1402 this->GetBucketIndices(xMin, minLevel);
1403 this->GetBucketIndices(xMax, maxLevel);
1404
1405 for (i = minLevel[0]; i <= maxLevel[0]; i++)
1406 {
1407 for (j = minLevel[1]; j <= maxLevel[1]; j++)
1408 {
1409 if (i < (ij[0] - level) || i > (ij[0] + level) || j < (ij[1] - level) || j > (ij[1] + level))
1410 {
1411 nei[0] = i;
1412 nei[1] = j;
1413 buckets->InsertNextBucket(nei);
1414 }
1415 }
1416 }
1417}
1418
1419//------------------------------------------------------------------------------
1420// Internal method to find those buckets that are within distance specified

Callers 3

FindClosestPointMethod · 0.95

Calls 4

GetNumberOfIdsMethod · 0.95
ResetMethod · 0.45
GetBucketIndicesMethod · 0.45
InsertNextBucketMethod · 0.45

Tested by

no test coverage detected