[vtkusers] ->Update()....what does that do?
Giancarlo Amati
ilferraresebono at hotmail.it
Thu Feb 4 05:02:15 EST 2010
Hi Clint,
yeah I've done that...but likely I lose the pointer....
The code I wrote is part of a function member in my main class so.. ... I don't quite get why Vtk behaves like that.
May be I have to cast safely the QArrayByte...in a different way?
dunnow what to think about.
Giancarlo
> From: clinton at elemtech.com
> To: vtkusers at vtk.org
> Subject: Re: [vtkusers] ->Update()....what does that do?
> Date: Wed, 3 Feb 2010 10:50:22 -0700
> CC: ilferraresebono at hotmail.it; daviddoria+vtk at gmail.com
>
>
> There is the common problem of the char* pointer becoming invalid when the
> QByteArray goes out of scope. But if you're not omitting anything from your
> code snippet, I guess that's not your problem. What about using a debugger
> and checking data when it goes to SetFileName(data).
>
> Clint
>
> On Wednesday 03 February 2010 10:41:13 am Giancarlo Amati wrote:
> > Hi David,
> >
> > yes I opened the file with Paraview and it's all perfectly visualised.
> > I've printed 'data' and the path name is ok.
> >
> > what the compiler returns is this:
> > Unhandled exception at 0x775c1ffe in QTVTK_Diorama.exe: 0xC0000005: Access
> > violation reading location 0x5f5bc9f4.
> >
> > Many Thanks.
> > Giancarlo
> >
> > Date: Wed, 3 Feb 2010 11:43:40 -0500
> > From: daviddoria+vtk at gmail.com
> > CC: vtkusers at vtk.org
> > Subject: Re: [vtkusers] ->Update()....what does that do?
> >
> > 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
> > _________________________________________________________________
> > Personalizza la tua vita digitale, scarica i nuovi gadget!
> > http://www.pimpit.it/
>
_________________________________________________________________
Tutto lo spazio che ti serve, lo trovi su Hotmail
http://www.windowslive.it/hotmail/SpazioDisponibile.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100204/8a61572e/attachment.htm>
More information about the vtkusers
mailing list