[vtkusers] Proper way to append to vtkPoints

David Lonie david.lonie at kitware.com
Mon Sep 19 14:16:35 EDT 2016


On Mon, Sep 19, 2016 at 11:01 AM, Cory Quammen <cory.quammen at kitware.com>
wrote:

> David, do you have a more future-proof way to do bulk copying of data
> into data arrays?
>

Unless you need to worry about mixing the new struct-of-arrays layout
arrays (vtkSOADataArrayTemplate) with the default array-of-structs arrays
(which is unlikely unless you've explicitly used them elsewhere in your
code), you can just use SetArray:

double *pointBuffer = ...;
vtkDoubleArray *array = vtkDoubleArray::FastDownCast(points->GetData());
assert(array);
array->SetArray(pointBuffer, size, true);

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160919/31627ff6/attachment.html>


More information about the vtkusers mailing list