<div dir='auto'><div><div class="gmail_extra"><div class="gmail_quote"><br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Thanks
<br>
<br>
I tried:
<br>
<br>
vtkSmartPointer<vtkRenderWindow> renderWindow =
<br>
vtkSmartPointer<vtkRenderWindow>::New();
<br>
ui->widget->SetRenderWindow(renderWindow);
<br>
<br>
This compiles OK, but when I run, it immediately gives the error:
<br>
<br>
QVTKOpenGLWidget requires a `vtkGenericOpenGLRenderWindow`. `
<br>
vtkWin32OpenGLRenderWindow ` is not supported.
<br>
<br>
because I presume this is the wrong type.
<br>
Strangely,
<br>
</p></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">That's expected. It's why I said to check the type of the returned render window object. If it is a vtkGenericOpenGLRenderWindow you need to dynamically cast it before passing it to SetRenderWindow()</div><div dir="auto"><br></div><div dir="auto">Are you able to debug your code with break points?</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">vtkSmartPointer<vtkRenderWindow> renderWindow =
<br>
ui->widget->GetRenderWindow();
<br>
<br>
is allowed, and runs - though it fails to render because I think the context
<br>
is wrong (ie in main.cpp I have the line
<br>
<br>
<br>
QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());
<br>
<br>
which allows me to render in the QVTKpenGLWidget
<br>
<br>
However,
<br>
<br>
vtkNew<vtkGenericOpenGLRenderWindow> renderWindow =
<br>
ui->widget->GetRenderWindow()
<br>
<br>
is not allowed by the compiler - telling me that GetRenderWindow() is
<br>
expecting a vtkRenderWindow, not an OpenGL one.
<br>
<br>
So it seems I can create a new OpenGL RenderWindow and set the widget Window
<br>
to this :
<br>
<br>
vtkNew<vtkGenericOpenGLRenderWindow> renderWindow;
<br>
ui->widget->SetRenderWindow(renderWindow);
<br>
<br>
and this gives be the sphere on screen, moveable mouse, but no contour
<br>
widget.
<br>
<br>
But I can't grab the existing render window from the widget, because
<br>
<br>
vtkSmartPointer<vtkRenderWindow> renderWindow =
<br>
ui->widget->GetRenderWindow();
<br>
<br>
compiles, but fails at runtime (I think due to the mismatch between a
<br>
vtkRenderWindow and an OpenGL one), and
<br>
<br>
vtkNew<vtkGenericOpenGLRenderWindow> renderWindow =
<br>
ui->widget->GetRenderWindow()
<br>
<br>
will not compile because of the perceived type mismatch.
<br>
<br>
<br>
<br>
<br>
--
<br>
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
<br>
_______________________________________________
<br>
Powered by www.kitware.com
<br>
<br>
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
<br>
<br>
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
<br>
<br>
Search the list archives at: http://markmail.org/search/?q=vtkusers
<br>
<br>
Follow this link to subscribe/unsubscribe:
<br>
https://public.kitware.com/mailman/listinfo/vtkusers
<br>
</p>
</blockquote></div><br></div></div></div>