[vtkusers] Render images in threads other than main thread

Todd Martin nztoddler at yahoo.com
Mon Apr 9 03:02:09 EDT 2018


How often your worker thread calls back to the main thread is entirely dependent on what your thread is doing. I assume that would be each time it finishes another block of geometry for rendering. Anyway the key point is that the method to update the GUI must be synchronised with the main thread. 
Without some example code of what you're trying to do, it is impossible to make any further recommendations.



Todd Martin, Ph.D.
Freelance Engineer/Software Architect.
 

    On Monday, April 9, 2018, 6:29:44 PM GMT+12, lor fal <lorfalwit at gmail.com> wrote:  
 
 Hi Todd,Thanks for your advice. The problem is that I want to render the image in real-time. The solution suggested in the link you posted is no other than a repeating timer. Is there some way in Vtk to control the update rate?

On Mon, Apr 2, 2018 at 6:31 PM, Todd <nztoddler at yahoo.com> wrote:

Hi Hugh
GUI elements are normally only updated on the main thread, so I suspect you need to synchronize your callback from the worker thread. I'm not familiar with Qt, but it seems to be documented. http://www.informit.com/ articles/article.aspx?p= 1405551&seqNum=3
Todd

On 2 Apr 2018 10:00 p.m., lor fal <lorfalwit at gmail.com> wrote:

Hi all:
I am using QVTKOpenGLWidget to bridge between Qt and Vtk. However, when I trying to call vtkRenderWindowInteractor:: Render in worker thread, it always report error like "makeCurrent() error", which seems something wrong while changing OpenGL context. I have googled my questions and found some suggestions but none of them could work.
Does anybody know exactly how to render images in worker thread?
Thanks in advance.

-- 
Best regards,
Hugh Lo





-- 
Best regards,
Hugh Lo  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180409/d3aca804/attachment.html>


More information about the vtkusers mailing list