Hi Luca,

sorry for the late reply, we are currently in the process of finalizing new 
features for the upcoming MITK release in April / Mai.

If you have an IRenderWindowPart I guess you are casting it to a an 
QmitkStdMultiWidgetEditor (or at least an QmitkAbstractMultiWidgetEditor), 
right?

The QmitkAbstractMultiWidgetEditor (which is also the base class of the 
QmitkStdMultiWidgetEditor) provides a function to retrieve the contained 
QmitkAbtractMultiWidget (QmitkStdMultiWidget):

-          QmitkAbstractMultiWidgetEditor::GetMultiWidget()

You can use this function to get the multi widget and pass it on to your 
QmitkMultiWidgetLayoutManager.
However, we were wondering how you use the layout manager:
If you already have e.g. a QmitkStdMultiWidgetEditor (because you retrieved it 
using e.g. QmitkAbstractView::GetRenderWindowPart and then casting it) then an 
instance of a QmitkStdMultiWidget can be retrieved (see paragraph above).
With this QmitkStdMultiWidget you can call 
QmitkAbstractMultiWidget::GetMultiWidgetLayoutManager() and you will get an 
instance of a QmitkMultiWidgetLayoutManager. Because each 
QmitkAbstractMultiWidget already comes with a layout manger, see initializer 
list of QmitkAbstractMultiWidget::Impl::Impl.

Also, you don’t need to call 
QmitkMultiWidgetLayoutManager::SetAll2DLeft3DRightLayout, you can also use 
QmitkMultiWidgetLayoutManager::SetLayoutDesign with the required argument, e.g. 
QmitkMultiWidgetLayoutManager::SetLayoutDesign(LayoutDesign::ALL_2D_LEFT_3D_RIGHT)

Let me know if this helps.

Best,

Amir

Von: Luca Pegolotti <pegolotti.l...@gmail.com>
Gesendet: Thursday, 9 March, 2023 01:00
An: mitk-users@lists.sourceforge.net
Betreff: [mitk-users] Changing layout of central widget to 2X 2D left and 3D 
right

Hi MITK community,

I am dealing with some legacy code that used the function 
changeLayoutTo2x2Dand3DWidget in QmitkStdMultiWidget (not available anymore) to 
change the layout of the 4 window widget at the center of the workbench.

I am trying to update the code to use IRenderWindowPart instead (as suggested 
by this<https://www.mitk.org/wiki/Views_Without_Multi_Widget> documentation 
page). My guess is that the correct way to do this now is to use 
QmitkMultiWidgetLayoutManager<https://docs.mitk.org/nightly/classQmitkMultiWidgetLayoutManager.html>,
 in particular the method SetAll2DLeft3DRightLayout, but I don’t understand how 
to pass the current QmitkAbstractMultiWidget to its constructor or its 
SetCurrentRenderWindowWidget method.

Am I on the right track? If so, what would be the correct way of getting an 
QmitkAbstractMultiWidget object to pass to QmitkMultiWidgetLayoutManage from 
IRenderWindowPart?


Best regards,
Luca Pegolotti



_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to