[vtk-developers] Interaction with color/opacity editors in vtkChartXY broken on retina display

Elvis Stansvik elvis.stansvik at orexplore.com
Mon May 29 11:35:50 EDT 2017


2017-05-29 17:06 GMT+02:00 Marcus D. Hanwell <marcus.hanwell at kitware.com>:
> On Mon, May 29, 2017 at 9:32 AM, Elvis Stansvik
> <elvis.stansvik at orexplore.com> wrote:
>>
>> 2017-05-29 15:26 GMT+02:00 Sebastien Jourdain <sebastien.jourdain at kitware.com>:
>> > You need to set the size on the interactor.
>>
>> Ah, how do I do that? (sorry for being a bit dumb)
>>
>> I've been scouring over the PV code, and I can't see that it does
>> anything special with its interactor. It seems to just hook it up:
>>
> I assume you are using QVTKOpenGLWidget, we use this directly in
> Tomviz for a few charts that control color/opacity too. This should be
> handled in the QVTKOpenGLWidget, but it is possible an initialization
> bug has crept in. I have noticed that ParaView often doesn't see this
> issues as much due to resizing Qt widgets several times on startup, I
> will see if I can get some time to test the latest Tomviz (we had this
> working, but I haven't been tracking VTK master as closely these last
> few weeks).

Yep, using QVTKOpenGLWidget.

Ah yes, I was able to do some findings (gotto go home now though):

My situation is that the color/opacity editors are initially hidden,
and I only show them in response to a user checking a checkbox.

If in in my two widgets, I reimplement showEvent(..) and add

    GetInteractor()->UpdateSize(width() *
window()->windowHandle()->devicePixelRatio(),
        height() * window()->windowHandle()->devicePixelRatio());
    GetInteractor()->InvokeEvent(vtkCommand::ConfigureEvent, NULL);

then it seems I get correct interactor size when showing them for the
first time.

Not sure if some machinery in vtkCocoaRenderWindow is insufficient. It
seems to do the above in response to NSViewFrameDidChangeNotification.

Elvis


More information about the vtk-developers mailing list