vtkAbstractArray::Reset() does not really reset arrays
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
The Reset() method does not reset all array state. For instance, in vtkVariantArray, the lookup structure is not reset. This leads to unexpected behavior. This example shows the problem.
vtkVariantArray* array = vtkVariantArray::New() array->SetNumberOfTuples(5); array->InsertNextTuple(value); ...
vtkIdType idx = array->LookupValue(value); // idx is > -1
array->Reset(); idx = array->LookupValue(value); // idx should be -1, but is larger than -1
Reset() should be made virtual to give subclasses a chance to override and reset any additional state they define. A pass through VTK data arrays should be made to verify that all state is reset when Reset() is called.