How to integrate WxWidgets and VTK?

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Nilesh444
In need of some credit
In need of some credit
Posts: 1
Joined: Tue Jun 26, 2018 8:47 am

How to integrate WxWidgets and VTK?

Post by Nilesh444 »

Does anyone know how to integrate WxWidgets and VTK.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to integrate WxWidgets and VTK?

Post by doublemax »

There is an old project named wxVTK. Most likely it won't compile today, but studying its source should be helpful:
https://github.com/vadz/wxVTK
Use the source, Luke!
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: How to integrate WxWidgets and VTK?

Post by PB »

I myself have no experience with it, but this should be an updated version of wxVTK (wxWidgets 3 and VTK 8):
https://github.com/harshn05/wxvtk-UpdatedOnJan23_2018
User avatar
JohnKnow
Knows some wx things
Knows some wx things
Posts: 41
Joined: Tue Aug 31, 2021 4:14 am

Re: How to integrate WxWidgets and VTK?

Post by JohnKnow »

I'm trying VTK too.
But VTK 9.1 is not frendly with my env(mingw64), and I don't want to spend time to resolve the compile error now. Though VTK supports Qt(announced), I don't like Qt's complicated way.

If you need draw charts, there are both opensource and commercial candidates for wxWidgets.
Check https://www.wxwidgets.org/blog/2018/08/ ... lications/
No, I know everything.
cbrinck
In need of some credit
In need of some credit
Posts: 1
Joined: Fri Jun 03, 2022 2:08 am

Re: How to integrate WxWidgets and VTK?

Post by cbrinck »

I've had success with this. Here's my code (in Python)

Code: Select all

# Import required modules and objects
import vtk
from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor

# Instantiate a new VTK render window
window = vtk.vtkRenderWindow()

# Instantiate a new wxVTKRenderWIndowInteractor (note: "panel" below is a placeholder for any wxWindow object you want to embed into)
interactor = wxVTKRenderWindowInteractor(panel, wx.ID_ANY)

# Link the VTK render window to the wxVTKRenderWindowInteractor
interactor.SetRenderWindow(window)
Last edited by cbrinck on Fri Jun 03, 2022 2:22 am, edited 2 times in total.
Post Reply