[vtkusers] Using thread with vtk
pahsieh at usgs.gov
pahsieh at usgs.gov
Fri Jun 9 22:31:27 EDT 2000
> Can anyone help? The attachment is the program that I've struggled over
> nights.
> But still fail to find what's wrong. Actually, it's modified from the
> example expcos.cxx.
> As I'm working with something related to real time visualization. So, I
> want to test
> if thread can work properly with vtk. The following is the code for
> threading. Due
> to the code "ren->GetActiveCamera()->Azimuth(10);". I expect the actor
> in
> the window will azimuth(10) every 0.5s. But for my surprise, it
> doesn't!! Can anyone
> tell me what's wrong? Many thanks
I think you approach is problematic because the threads are not
synchronized. There is a main thread running in the event loop
of the vtk window, and then a separate thread created by the program.
The two threads are trying to draw to the window without coordination.
I am sending you separately a sample code that is a variation
of the "sample" (VC++/MFC) project that is included with the
vtk source code (for Windows). Hopefully that might help you out.
Good luck.
Paul Hsieh
More information about the vtkusers
mailing list