------------------------------------------------------------------------------
| 298 | |
| 299 | //------------------------------------------------------------------------------ |
| 300 | void vtkDataArraySelection::SetArraysWithDefault( |
| 301 | const char* const* names, int numArrays, int defaultStatus) |
| 302 | { |
| 303 | // This function is called only by the filter owning the selection. |
| 304 | // It should not call Modified() because array settings are not |
| 305 | // changed. |
| 306 | |
| 307 | vtkDebugMacro("Settings arrays to given list of " << numArrays << " arrays."); |
| 308 | |
| 309 | // Create a new map for this set of arrays. |
| 310 | vtkInternals* newInternal = new vtkInternals; |
| 311 | |
| 312 | newInternal->Arrays.reserve(numArrays); |
| 313 | |
| 314 | // Fill with settings for all arrays. |
| 315 | for (int i = 0; i < numArrays; ++i) |
| 316 | { |
| 317 | // Fill in the setting. Use the old value if available. |
| 318 | // Otherwise, use the given default. |
| 319 | bool setting = defaultStatus != 0; |
| 320 | auto iter = this->Internal->Find(names[i]); |
| 321 | if (iter != this->Internal->Arrays.end()) |
| 322 | { |
| 323 | setting = iter->second; |
| 324 | } |
| 325 | newInternal->Arrays.emplace_back(names[i], setting); |
| 326 | } |
| 327 | |
| 328 | // Delete the old map and save the new one. |
| 329 | this->Internal.reset(newInternal); |
| 330 | this->Modified(); |
| 331 | } |
| 332 | |
| 333 | //------------------------------------------------------------------------------ |
| 334 | void vtkDataArraySelection::CopySelections(vtkDataArraySelection* selections) |