[vtkusers] Zero-Copy data export from a vtkFloatArray or vtkImageData
Khaldoun Zine El Abidine
khaldoun at dynapix-intelligence.com
Mon Jun 28 11:41:10 EDT 2004
Hi,
One can currently access the internal data pointer of a vtkFloatArray
instance using :
float * ptr = fArray->GetPointer (0);
How can I delete the array instance (with fArray->Delete() ) without
losing the raw data array and without having to copy it ? Zero-copy data
passing is an important issue for me since I deal with large 3D data
sets .
Thank you very much for your help.
Khaldoun.
PS : The only way to access the 'SaveUserArray' attribute is through the
vtkFloatArray::SetArray() method. A workaround would have been to do the
following :
float * ptr = fArray->GetPointer (0);
fArray->SetArray (ptr, size, 1);
hoping that the last instruction would modify the SaveUserArray and
prevent the deletion of the data pointer. Unfortunately the SetArray
method deletes the data array prior to changing the SaveUserArray
attribute !! Is there a simpler way than inheriting from vtkFloatArray
and adding an accessor on the SaveUserArray attribute ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040628/a7d6613f/attachment.htm>
More information about the vtkusers
mailing list