[vtkusers] How to get data ptr from the vtkpolydata?

David Doria daviddoria at gmail.com
Wed Sep 17 07:41:41 EDT 2014

On Wed, Sep 17, 2014 at 7:17 AM, Lin M <majcjc at gmail.com> wrote:

> Hi all,
> I try to get the data ptr which I think is a double * pointing to a double
> array from vtkpolydata but I met an access violation when I use
> double *skullTemplate =
> vtkDoubleArray::SafeDownCast(m_SkullMesh->GetOutput()->GetPoints()->GetData())->GetPointer(0);
> m_SkullMesh is a vtkPolyData.
> How can I do to get it work? Thank you!
> Best,
> Lin

Please post the smallest, compilable code you can that demonstrates the
problem. From what you've shown, one error is that you shouldn't have to
GetOutput() from a vtkPolyData.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140917/8aa44ef5/attachment.html>

More information about the vtkusers mailing list