[vtkusers] VTK 7.1 vtkDataArray changes, current best way to copy vtkPolyData data?

David Lonie david.lonie at kitware.com
Fri Jun 9 09:42:12 EDT 2017


If you just want to dump the data from any vtkDataArray into a memory
buffer using AOS ordering (e.g. typical VTK memory layout with
coherent tuples), something like:

vtkDataArray *array = ...;
int bufSize = array->GetNumberOfValues() * array->GetDataTypeSize();
void *buffer = malloc(bufSize);
array->ExportToVoidPointer(buffer);

will be the most efficient way to do this.

HTH,
Dave

On Thu, Jun 8, 2017 at 12:14 PM, Sean McBride <sean at rogue-research.com> wrote:
> Hi all,
>
> Since the vtkDataArray changes in VTK 7.1, what is the current best/fastest way to extract the points, strips, and normals from a vtkPolyData into another memory buffer?
>
> I'm always working with the same kind of data, so I'm hoping to preflight the sizes/types and then basically memcpy() the data out.
>
> Thanks,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers


More information about the vtkusers mailing list