来自主线程的 VTK 窗口线程,C++
我刚刚学习 VTK(和 C++ GUI 编程),希望有一个简单的问题。
主应用程序在应用程序中的某个时刻启动渲染的窗口。希望在显示 VTK 窗口时主线程能够继续。是否有特定的方法可以将 VTK 窗口作为线程启动?
我的环境是 Linux,可以使用 boost 和 pthreads。 谢谢。
VTK是可视化工具包,参见vtk.org
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以调用 vtkRenderWindowInteractor->Start() 方法。 (如果您没有创建交互器,请从渲染器获取交互器)。
VTK 中包含大量示例;你应该看看那些!如果没有它们,请确保在使用 cmake 构建 VTK 时打开 VTK_BUILD_EXAMPLES。
编辑:
您应该看一下 GUI 示例,因为这似乎是您想要构建的。
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.
这是我的解决方案。希望这有帮助!
Here is my solution. Hope this helps!