Search code examples
pythonc++wxwidgetsvtk

Embedding VTK output in wxpanel with C++


I am a C++ beginner and looking for a working example which embeds VTK output in wxpanel with C++ language. I came across the following https://sourceforge.net/projects/wxvtk/ which was last updated four years ago, and doesn't compile with the latest cmake, VTK and WxWidgets. I am using MinGW-W64 compiler on windows 10. I see that the same can be easily done using python which must be using some C++/C code internally.


Solution

  • I finally modified the original source-code of wxvtk and CMakeLists.txt in order to make it work with WxWidgets-3.0.3 and VTK-8. Modifications were required since a lot has changed in VTK source code during last five years or so. The modified version with updated source code is available here. It builds wxVTKRenderWindowInteractor.(dll,lib) as well as compiles a minimal working example (SAMPLE.cpp) with dynamic linking to the wxVTKRenderWindowInteractor.dll leading to MAIN.exe. A screenshot of the output window (MAIN.exe) is shown below:

    enter image description here

    I hope it will be helpful for the community.