[vtkusers] Displaying vtkPolyData while writing on it within Qt objects (QVTKWidget)
David E DeMarle
dave.demarle at kitware.com
Mon Jun 21 09:10:26 EDT 2010
Unfortunately, VTK is not thread safe (with the important exception of
things that happen inside image filters). So, you will have to provide
you own synchronization, making sure that no two threads access the
same (or coupled) VTK data structures at the same time. A few people
on this list have done this before, perhaps they will chime in with
advice.
David E DeMarle
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109
On Mon, Jun 21, 2010 at 3:47 AM, Barth, Sebastian
<sebastian.barth at iosb.fraunhofer.de> wrote:
> Hello Clint,
>
> yes, I call Modified() and it's working, but that's not the problem. The point ist that Qt does not invoke the QTimer event while the mouse is moving. This is a Qt problem and I guess I have to use different threads to avoid this: One for the interface with the QVTKWidget and one for the QTimer which forces the manipulation of the vtkPolyData. I don't know if there is a better way.
>
> For this I want to know if there are some things I have to know if I want to have access to one vtkPolyData from out two different threads (QThread). There are few informations about QThread and almost none about VTK at a multithreading point.
>
> I hope someone can give me some instructions, because I know almost nothing about threads in this scope (VTK + Qt).
>
> Thanks a lot
>
> Sebastian
>
> -----Ursprüngliche Nachricht-----
> Von: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] Im Auftrag von Clinton Stimpson
> Gesendet: Freitag, 18. Juni 2010 22:23
> An: vtkusers at vtk.org
> Betreff: Re: [vtkusers] Displaying vtkPolyData while writing on it within Qt objects (QVTKWidget)
>
> On Friday, June 18, 2010 09:22:42 am Barth, Sebastian wrote:
>> Hello vtkusers,
>>
>> my application uses the QVTKWidget with Qt 4.6.2 and VTK 5.6.0 as a part of
>> it's window.
>>
>> I have a 3D visualisation of a cluster of points stored in a vtkPolyData.
>> On my Qt window I can start a QTimer whose timeout() signal is connected
>> to a slot which manipulates the points in the vtkPolyData and updates the
>> visualisation pipeline with QVTKWidget::update().
>>
>> My vtkRendererWindow uses the default interactor style (trackball camera).
>>
>> While moving the camera (mouse interaction) the QVTKWindow gets updated,
>> but the vtkPolyData does not. This of course, is a Qt problem, but I want
>> to know if I have to do anything special if I want to write on the
>> vtkPolyData object from out another thread (QThread) while I'm moving the
>> camera and displaying the current written Data. Maybe there is a simplier
>> solution, I don't know!
>>
>> It's the first time I work with VTK, QT and even threads and I appreciate
>> every help!
>>
>
> Are you calling Modifed() on the vtkPolyData after modifying its points?
>
> Clint
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list