[vtkusers] Probably Bug in vtkCharArray
Samson Timoner
samson at mit.edu
Tue Mar 11 21:12:41 EST 2003
I'm not getting cvs stuff, but here is what I think is a bug in vtk4.0
which has not been fixed according to what is on the web site:
vtkCharArray::DeepCopy(vtkDataArray *)
If you send this command a vtkIntArray, it does a memcopy.
I assume this is not the right thing to do. You instead want
to convert each int to char, one int at a time.
Every other class does the right thing. vtkBitArray, vtkDoubleArray,
vtkLongArray, etc. all copy one element at a time when the element is a
different type. (they do a memcopy when the element is the same type)
In fact, vtkUnsignedCharArray has it right.
I'm not sure if I have found a bug or if someone decided to be inconsistent
on purpose. But, I'm guessing bug.
The Fix: Just use the DeepCopy command in any of the other classes.
Only the memory allocation line and the memcopy line differ.
Cheers,
-- Samson
More information about the vtkusers
mailing list