[vtkusers] ->Update()....what does that do?

David Doria daviddoria+vtk at gmail.com
Wed Feb 3 11:43:40 EST 2010


On Wed, Feb 3, 2010 at 11:33 AM, Giancarlo Amati <ilferraresebono at hotmail.it
> wrote:

>  Hello VTK users,
> this might be already posted but I can't find it in the repository. So, I
> apologies for any duplicate.
>
> I have these statements:
>
> QByteArray temp = fn->toAscii();
> char *data = temp.data();
>         vtkSmartPointer<vtkPolyDataReader> drs =
> vtkSmartPointer<vtkPolyDataReader>::New();
>         drs->SetFileName(data);
>          drs->Update();
>         vtkPolyData *pd = drs->GetOutput();
>
> where QByteArray is a QT array of byte then converted into a string and
> passed as input to PolyDataReader. so basically it's the path of the file
> .vtk (which is a polydata) I would like to load.
>
> but the problem is that when i get to
>
> drs->Update();
>
> it all crashes saying that an Unhandled expection has been generated.
>
> I checked out around and apparently it's the standard way to read a vtk
> file (the one I have is ASCII format).
>
> Any suggestion would be helpful..
>
> Kind Regards.
> Giancarlo Amati
>
>
A couple of things -

1) try opening the file with Paraview. If it crashes, your file is bad.
2) did you print 'data' to make sure the file name is as you expect?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100203/fcf050f9/attachment.htm>


More information about the vtkusers mailing list