vtkDataSetAttributes: SetAttribute enhancement
Description
Currently, the call to vtkDataSetAttributes::SetAttribute
will add the array and then set its index as the current active array of the specified attribute. However, if the attribute is already set to another array index, it will first remove the array, then set the new one as the active one.
Enhancement
Sometimes, it could be useful to keep both arrays in order to do further comparison with old values. We can already do that by manually setting the active array of an attribute to -1 (index for no array), and then calling the SetAttribute
function. A small enhancement could be to add a parameter to this function with a default value that keeps the current behavior of replacing the array, that allows keeping the old array.
The following signature could be used, as an example:
From int SetAttribute(vtkAbstractArray* aa, int attributeType);
To int SetAttribute(vtkAbstractArray* aa, int attributeType, bool squash = true);