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

Method RetrieveData

Filters/Parallel/vtkPKdTree.cxx:2157–2212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2155#ifdef YIELDS_INCONSISTENT_REGION_BOUNDARIES
2156
2157void vtkPKdTree::RetrieveData(vtkKdNode* kd, int* sources)
2158{
2159 int i;
2160 double data[27];
2161
2162 if (kd->GetLeft() == nullptr)
2163 return;
2164
2165 int ihave = (kd->GetDim() < 3);
2166
2167 this->SubGroup->Gather(&ihave, sources, 1, 0);
2168 this->SubGroup->Broadcast(sources, this->NumProcesses, 0);
2169
2170 // a contiguous group of process IDs built this node, the first
2171 // in the group broadcasts the results to everyone else
2172
2173 int root = -1;
2174
2175 for (i = 0; i < this->NumProcesses; i++)
2176 {
2177 if (sources[i])
2178 {
2179 root = i;
2180 break;
2181 }
2182 }
2183 if (root == -1)
2184 {
2185 // Normally BuildLocator will create a complete tree, but
2186 // it may refuse to divide a region if all the data is at
2187 // the same point along the axis it wishes to divide. In
2188 // that case, this region was not divided, so just return.
2189
2190 vtkKdTree::DeleteAllDescendants(kd);
2191
2192 return;
2193 }
2194
2195 if (root == this->MyId)
2196 {
2197 vtkPKdTree::PackData(kd, data);
2198 }
2199
2200 this->SubGroup->Broadcast(data, 27, root);
2201
2202 if (!ihave)
2203 {
2204 vtkPKdTree::UnpackData(kd, data);
2205 }
2206
2207 this->RetrieveData(kd->GetLeft(), sources);
2208
2209 this->RetrieveData(kd->GetRight(), sources);
2210
2211 return;
2212}
2213#endif
2214

Callers 1

CompleteTreeMethod · 0.95

Calls 2

GatherMethod · 0.45
BroadcastMethod · 0.45

Tested by

no test coverage detected