VTK PyQT QtDegner

Reference Link

  1. VTK的安装与测试

    注:为什么要编译两遍VTK?因为在debug版本下编译的QVTKWidget打不开,无法使用,只能使用release下的QVTKWidget,所以要编译release版,但写程序必须要调试,VTK的库必须是debug版本的才能正常调试,为此我们编译两次。

  2. VTK/Tutorials/QtSetup
    1. Add a new environment variable:

      Add a new environment variable:

    2. Append the environment variable PATH to add

      C:\Qt\4.X.X\bin
      C:\VTKbuild\bin\Release
      (or \bin\Debug if that is how you have built VTK)

    3. CopyQVTKWidgetPlugin.libandQVTKWidgetPlugin.dllfromPathToVTK\bin\DebugtoPathTo\PyQt4\plugins\designer

      According Link 1, QVTKWidgetPlugin.lib and QVTKWidgetPlugin.dll should compile in Release

From .ui to .py

  1. Design .ui from qt desiner (use QVTKWiget)
  2. Generate .py by pyuic4
1
pyuic4 input.ui -o output.py

3. Change QVTKWidget to QVTKRenderWindowInteractor

Original file
Modify file

4. Add a MainApp.py to use this class

Comments