| 3308 | } |
| 3309 | |
| 3310 | int vtkPKdTree::ViewOrderAllProcessesFromPosition(const double pos[3], vtkIntArray* orderedList) |
| 3311 | { |
| 3312 | assert("pre: orderedList_exists" && orderedList != nullptr); |
| 3313 | |
| 3314 | vtkIntArray* regionList = vtkIntArray::New(); |
| 3315 | |
| 3316 | this->ViewOrderAllRegionsFromPosition(pos, regionList); |
| 3317 | |
| 3318 | orderedList->SetNumberOfValues(this->NumProcesses); |
| 3319 | |
| 3320 | int nextId = 0; |
| 3321 | |
| 3322 | // if regions were not assigned contiguously, this |
| 3323 | // produces the wrong result |
| 3324 | |
| 3325 | for (int r = 0; r < this->GetNumberOfRegions();) |
| 3326 | { |
| 3327 | int procId = this->RegionAssignmentMap[regionList->GetValue(r)]; |
| 3328 | |
| 3329 | orderedList->SetValue(nextId++, procId); |
| 3330 | |
| 3331 | int nregions = this->NumRegionsAssigned[procId]; |
| 3332 | |
| 3333 | r += nregions; |
| 3334 | } |
| 3335 | |
| 3336 | regionList->Delete(); |
| 3337 | |
| 3338 | return this->NumProcesses; |
| 3339 | } |
| 3340 | |
| 3341 | int vtkPKdTree::GetRegionAssignmentList(int procId, vtkIntArray* list) |
| 3342 | { |
no test coverage detected