VTK窗口线程从主线程,C ++ [英] VTK window thread from main thread, C++

查看:463
本文介绍了VTK窗口线程从主线程,C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在学习VTK(和C ++ GUI编程),并且有希望的简单问题。主应用程序在应用程序的某个点上启动渲染窗口。想要能够继续主线程,同时显示VTK窗口。有没有特定的方法来启动VTK窗口作为线程?



我的环境是Linux,我可以使用boost和pthread。
感谢。



VTK是可视化工具包,请参阅vtk.org

解决方案

可以调用vtkRenderWindowInteractor-> Start()方法。



VTK中包含了大量的例子,如果你没有创建一个,就从你的渲染器中获取交互器。你应该看看那些!如果你没有它们,确保在使用cmake构建VTK时,打开VTK_BUILD_EXAMPLES。



编辑:



您应该看看GUI示例,因为这似乎是你试图建立。


I am just learning VTK (and C++ GUI programming) and have hopefully simple question.

The main application launches rendered window at some point in application. Would like to be able for the main thread to continue, while VTK window is displayed. Is there a particular method to launch VTK window as a thread?

My environment is Linux, with boost and pthreads at my disposal. Thanks.

VTK is visualization toolkit, see vtk.org

解决方案

You can call vtkRenderWindowInteractor->Start() method. (Get the interactor from your renderer if you didn't create one).

There are tons of examples included with VTK; you should take a look at those! If you don't have them, be sure that when building VTK with cmake, turn on VTK_BUILD_EXAMPLES.

Edit:

You should take a look at the GUI examples since that seems what you are trying to build.

这篇关于VTK窗口线程从主线程,C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆