I’m really new to VTK and I’m in the process of both reading the VTK online book and also trying to get a simple Qt-based application using a vtkContextItem-derived class to draw to a vtkContext2D. Anyway, I’ve been able to get a window to show up, but the vtkContextItem-derived object’s Paint() method never gets called and nothing displays other than a black window. I’ve looked online for examples and there just aren’t may using QVTKOpenGLWidget and a vtkContextItem-derived class. I was curious if someone knew what I am missing to tie everything together properly. Does anyone know?
My test application’s code is below for reference.
Unlike QVTKOpenGLNativeWidget, QVTKOpenGLWidget does not require that the default surface format for the application be changed. One can simply specify the needed QSurfaceFormat for the specific QVTKOpenGLWidget instance by calling QVTKOpenGLWidget::setFormat before the widget is initialized.
(Note the above is true for VTK 8.2.0 and higher. In versions prior, QVTKOpenGLNativeWidget was the only QOpenGLWidget-based widget, and it was called QVTKOpenGLWidget, and I think it required you to change the application default format)
Wow, I didn’t even know about the CTK library. There’s a lot of really cool things there. Once I get my feet under VTK, I’ll certainly take a look at that. Thank you!