[vtk-developers] Anti-aliasing / multi sampling in QVTKWidget2 ?

Marcus D. Hanwell marcus.hanwell at kitware.com
Mon Jan 12 09:35:44 EST 2015


On Mon, Jan 12, 2015 at 5:24 AM, Kilgus, Thomas
<t.kilgus at dkfz-heidelberg.de> wrote:
> Dear List,
>
> we recently switched from QVTKWidget to QVTKWidget2 and now by default
> anti-aliasing is disabled.
>
> We managed to track the issue down with this VTK example:
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance
>
> Just render the sphere in wireframe mode. If you run the example with a
> QVTKWidget, lines are smooth and with QVTKWidget2 they are stepped.
> SetMultiSamples(8) should do the job, but this does not have any effect (and
> is the default value).
>
> Any ideas on this?
>
As QVTKWidget reuses Qt's QGLWidget you must use the Qt API for any
OpenGL context settings. Multisampling is one of the things that must
be done as the context is created, and so cannot be done by VTK.

I can't remember the API off the top of my head, but I know Qt has API
in 4 at least for antialiasing. Qt 5 does not, but the new
QOpenGLWidget does - QGLWidget lost a number of features that seem to
have been reintroduced in this class in the 5.4 release.

Hope that helps clear this up a little.

Marcus


More information about the vtk-developers mailing list