------------------------------------------------------------------------------
| 128 | |
| 129 | //------------------------------------------------------------------------------ |
| 130 | int vtkHyperTreeGridPProbeFilter::RequestData(vtkInformation* vtkNotUsed(request), |
| 131 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 132 | { |
| 133 | this->UpdateProgress(0.0); |
| 134 | |
| 135 | // get the info objects |
| 136 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 137 | vtkInformation* sourceInfo = inputVector[1]->GetInformationObject(0); |
| 138 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 139 | |
| 140 | // get the input and output |
| 141 | vtkDataSet* input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 142 | vtkHyperTreeGrid* source = |
| 143 | vtkHyperTreeGrid::SafeDownCast(sourceInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 144 | vtkDataSet* output = vtkDataSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 145 | |
| 146 | if (!input || !source || !output) |
| 147 | { |
| 148 | vtkErrorMacro("Could not get either the input, source or output"); |
| 149 | return 0; |
| 150 | } |
| 151 | |
| 152 | // setup output |
| 153 | if (!(this->Initialize(input, source, output))) |
| 154 | { |
| 155 | vtkErrorMacro("Could not initialize output arrays"); |
| 156 | return 0; |
| 157 | } |
| 158 | |
| 159 | this->UpdateProgress(0.1); |
| 160 | |
| 161 | vtkNew<vtkIdList> localPointIds; |
| 162 | localPointIds->Initialize(); |
| 163 | // run probing on each source individually |
| 164 | if (!(this->DoProbing(input, source, output, localPointIds))) |
| 165 | { |
| 166 | vtkErrorMacro("Could not perform serial probing correctly"); |
| 167 | return 0; |
| 168 | } |
| 169 | |
| 170 | this->UpdateProgress(0.7); |
| 171 | |
| 172 | // gather the results to the master process |
| 173 | if (!(this->Reduce(source, output, localPointIds))) |
| 174 | { |
| 175 | vtkErrorMacro("Failed to communicate results to master process"); |
| 176 | return 0; |
| 177 | } |
| 178 | |
| 179 | this->UpdateProgress(1.0); |
| 180 | return 1; |
| 181 | } |
| 182 | |
| 183 | //------------------------------------------------------------------------------ |
| 184 | int vtkHyperTreeGridPProbeFilter::RequestUpdateExtent(vtkInformation* vtkNotUsed(request), |
nothing calls this directly
no test coverage detected