In order to make a custom camera reset in a 3D widget (qMRMLThreeDWidget), I need to access the vtkRenderWindow size after the call for the widget to show().
However, I noticed that the window size was (0,0) if performed shortly after the show(), likely due to the window not being fully rendered yet.
I tried and failed with the following attempts:
widget.show() widget.threeDView().renderWindow().WaitForCompletion() size = widget.threeDView().renderWindow().GetSize() # sill is (0,0)
widget.show() while not widget.visible: pass size = widget.threeDView().renderWindow().GetSize() # sill is (0,0)
Is there a way to get the size only once the 3D widget is done rendering ? Perhaps with through a connect to a signal or an observer for an event ?
Thanks for any help