-------------------------------------------------------------------------
| 164 | |
| 165 | //------------------------------------------------------------------------- |
| 166 | int vtkToImplicitArrayFilter::RequestData(vtkInformation* vtkNotUsed(info), |
| 167 | vtkInformationVector** inputInfo, vtkInformationVector* outputInfo) |
| 168 | { |
| 169 | auto input = vtkDataObject::GetData(inputInfo[0], 0); |
| 170 | auto output = vtkDataObject::GetData(outputInfo, 0); |
| 171 | output->ShallowCopy(input); |
| 172 | |
| 173 | if (!this->Internals->Strategy) |
| 174 | { |
| 175 | vtkWarningMacro("No strategy set in vtkToImplicitArrayFilter"); |
| 176 | return 1; |
| 177 | } |
| 178 | |
| 179 | for (int association = 0; association < vtkDataObject::NUMBER_OF_ASSOCIATIONS; ++association) |
| 180 | { |
| 181 | this->UpdateProgress(association / vtkDataObject::NUMBER_OF_ASSOCIATIONS); |
| 182 | |
| 183 | if (this->CheckAbort()) |
| 184 | { |
| 185 | break; |
| 186 | } |
| 187 | |
| 188 | auto outFD = output->GetAttributesAsFieldData(association); |
| 189 | auto outAttr = vtkDataSetAttributes::SafeDownCast(outFD); |
| 190 | |
| 191 | if (!outAttr) |
| 192 | { |
| 193 | continue; |
| 194 | } |
| 195 | |
| 196 | auto select = this->GetArraySelection(association); |
| 197 | if (!select) |
| 198 | { |
| 199 | vtkWarningMacro( |
| 200 | "Selection is nullptr for an attribute type when it should not be for any association."); |
| 201 | continue; |
| 202 | } |
| 203 | |
| 204 | const int nArrays = outAttr->GetNumberOfArrays(); |
| 205 | double progress = association / vtkDataObject::NUMBER_OF_ASSOCIATIONS; |
| 206 | double progressIncr = 1 / (vtkDataObject::NUMBER_OF_ASSOCIATIONS * (nArrays ? nArrays : 1)); |
| 207 | std::vector<int> arraysToRemove; |
| 208 | std::vector<vtkSmartPointer<vtkDataArray>> arraysToAdd; |
| 209 | for (int iArr = 0; iArr < nArrays; ++iArr) |
| 210 | { |
| 211 | vtkDataArray* arr = outAttr->GetArray(iArr); |
| 212 | if (!arr) |
| 213 | { |
| 214 | continue; |
| 215 | } |
| 216 | if (!select->ArrayIsEnabled(arr->GetName())) |
| 217 | { |
| 218 | continue; |
| 219 | } |
| 220 | |
| 221 | vtkToImplicitStrategy::Optional estimatedReduction = |
| 222 | this->Internals->Strategy->EstimateReduction(arr); |
| 223 |
nothing calls this directly
no test coverage detected