[vtkusers] initializing vtk array from std::vector for charting

David Lonie david.lonie at kitware.com
Mon Jun 27 08:41:33 EDT 2016

See vtkDoubleArray::SetArray


vtkUnsignedShortArray has a similar method.


On Mon, Jun 27, 2016 at 1:59 AM, arasu via vtkusers <vtkusers at vtk.org>

> I have data that is stored in std::vector - one for the X axis and one for
> the y axis. How do I get this into vtkarray / vtkTable for plotting - other
> than iterate through the vector and setting values one by one (there is a
> lot of data ).  my data is either std::vector<double> or
> std::vector<unsigned short>.
> Is there a way to assign a pointer from my data to the vtkarray, or at
> least do a bulk copy of all the data rather than individually setting the
> values.
> Thanks in advance,
> -Arasu
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160627/d588e71c/attachment.html>

More information about the vtkusers mailing list