[vtkusers] QVTKOpenGLWidget and vtkImageViewer
olivier.commowick at inria.fr
Tue Aug 1 13:49:31 EDT 2017
I have been struggling with using QVTKOpenGLWidget to display an image with the vtkImageViewer. My problem is basically that the image is loaded and everything created but it seems the rendering is never triggered and thus the display is black.
To summarize what I’ve done, I’ve created a vtkImageViewer3 which is the same as vtkImageViewer from VTK, only changing the vtkRenderWindow to be a vtkGenericOpenGLRenderWindow (required by the QVTKOpenGLWidget). I have then modified the ImageViewer example from VTK to match these new classes which gives the following code (see at the end). Oh, and I am using Qt5.7, and VTK 8.0 release.
Would anyone have any clue on what could make this work (i.e. actually render something and display it) ?
Thanks in advance
int main(int argc, char** argv)
QSurfaceFormat format = QVTKOpenGLWidget::defaultFormat();
QApplication app(argc, argv);
vtkPNGReader* reader = vtkPNGReader::New();
std::string fname = argv;
vtkImageViewer3* image_view = vtkImageViewer3::New();
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers