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

Method GetBucketNeighbors

Common/DataModel/vtkStaticPointLocator2D.cxx:101–143  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Internal function to get bucket neighbors at specified level

Source from the content-addressed store, hash-verified

99// Internal function to get bucket neighbors at specified level
100//
101void vtkBucketList2D::GetBucketNeighbors(
102 NeighborBuckets2D* buckets, const int ij[2], const int ndivs[2], int level)
103{
104 int i, j, min, max, minLevel[2], maxLevel[2];
105 int nei[2];
106
107 // Initialize
108 //
109 buckets->Reset();
110
111 // If at this bucket, just place into list
112 //
113 if (level == 0)
114 {
115 buckets->InsertNextBucket(ij);
116 return;
117 }
118
119 // Create permutations of the ij indices that are at the level
120 // required. If these are legal buckets, add to list for searching.
121 //
122 for (i = 0; i < 2; i++)
123 {
124 min = ij[i] - level;
125 max = ij[i] + level;
126 minLevel[i] = (min > 0 ? min : 0);
127 maxLevel[i] = (max < (ndivs[i] - 1) ? max : (ndivs[i] - 1));
128 }
129
130 for (i = minLevel[0]; i <= maxLevel[0]; i++)
131 {
132 for (j = minLevel[1]; j <= maxLevel[1]; j++)
133 {
134 if (i == (ij[0] + level) || i == (ij[0] - level) || j == (ij[1] + level) ||
135 j == (ij[1] - level))
136 {
137 nei[0] = i;
138 nei[1] = j;
139 buckets->InsertNextBucket(nei);
140 }
141 }
142 }
143}
144
145//------------------------------------------------------------------------------
146void vtkBucketList2D::GenerateFace(

Callers 3

FindClosestPointMethod · 0.45
FindClosestNPointsMethod · 0.45

Calls 2

ResetMethod · 0.45
InsertNextBucketMethod · 0.45

Tested by

no test coverage detected