------------------------------------------------------------------------------
| 97 | |
| 98 | //------------------------------------------------------------------------------ |
| 99 | bool vtkDistributedPointCloudFilter::InitializeKdTree(std::vector<vtkMPIController*>& kdTreeRounds) |
| 100 | { |
| 101 | this->Controller->Register(this); |
| 102 | |
| 103 | kdTreeRounds.push_back(vtkMPIController::SafeDownCast(this->Controller)); |
| 104 | |
| 105 | int index = 0; |
| 106 | while (kdTreeRounds[index]->GetNumberOfProcesses() > 2) |
| 107 | { |
| 108 | vtkMPIController* ctrl = kdTreeRounds[index]; |
| 109 | int roundRank = ctrl->GetLocalProcessId(); |
| 110 | int split = ctrl->GetNumberOfProcesses() / 2; |
| 111 | |
| 112 | int color = (roundRank < split) ? 0 : 1; |
| 113 | int key = roundRank - ((roundRank < split) ? 0 : split); |
| 114 | |
| 115 | vtkMPIController* subCtrl = ctrl->PartitionController(color, key); |
| 116 | if (subCtrl == nullptr) |
| 117 | { |
| 118 | break; |
| 119 | } |
| 120 | kdTreeRounds.push_back(subCtrl); |
| 121 | ++index; |
| 122 | } |
| 123 | |
| 124 | return true; |
| 125 | } |
| 126 | |
| 127 | //------------------------------------------------------------------------------ |
| 128 | bool vtkDistributedPointCloudFilter::OptimizeBoundingBox( |
no test coverage detected