------------------------------------------------------------------------------
| 156 | |
| 157 | //------------------------------------------------------------------------------ |
| 158 | void vtkRandomPool::PopulateDataArray(vtkDataArray* da, double minRange, double maxRange) |
| 159 | { |
| 160 | if (da == nullptr) |
| 161 | { |
| 162 | vtkWarningMacro(<< "Bad request"); |
| 163 | return; |
| 164 | } |
| 165 | |
| 166 | vtkIdType size = da->GetNumberOfTuples(); |
| 167 | int numComp = da->GetNumberOfComponents(); |
| 168 | |
| 169 | this->SetSize(size); |
| 170 | this->SetNumberOfComponents(numComp); |
| 171 | const double* pool = this->GeneratePool(); |
| 172 | if (pool == nullptr) |
| 173 | { |
| 174 | return; |
| 175 | } |
| 176 | |
| 177 | // Now perform the scaling of all components |
| 178 | using Dispatcher = vtkArrayDispatch::Dispatch; |
| 179 | PopulateLauncher worker; |
| 180 | if (!Dispatcher::Execute(da, worker, pool, minRange, maxRange)) |
| 181 | { // Fallback for unknown array types: |
| 182 | worker(da, pool, minRange, maxRange); |
| 183 | } |
| 184 | |
| 185 | // Make sure that the data array is marked modified |
| 186 | da->Modified(); |
| 187 | } |
| 188 | |
| 189 | //------------------------------------------------------------------------------ |
| 190 | void vtkRandomPool::PopulateDataArray( |