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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Sean McBride
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                 [hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK 7.1 vtkDataArray changes, current best way to copy vtkPolyData data?

David Lonie-2
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 <[hidden email]> 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                 [hidden email]
> 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
_______________________________________________
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
Loading...