Hi Stefan,
I managed to change the layout with the following code using your casting
approach.
mitk::IRenderWindowPart* render_winow_part = GetRenderWindowPart();
auto editor = dynamic_cast<QmitkStdMultiWidgetEditor*>(render_winow_part);
if (editor != nullptr)
{
auto widget = editor->GetStdMultiWidget();
widget->changeLayoutToBig3D();
}
However, this seems to beak the layout toggle button of the
QmitkRenderWindowMenu. I would have expected for the layout to change back to
default when I press the button. Instead, the view stays the same each time I
click the button. The button icon however switches back to the default icon
with the four planes and the printout to the console always states "changing
layout to big 3D ...".
Any ideas how this breaks the button functionality and how to fix this?
Thanks,
Matthias
PS:
From: Dinkelacker, Stefan [mailto:s.dinkelac...@dkfz-heidelberg.de]
Sent: Mittwoch, 24. Mai 2017 10:33
To: Noll, Matthias <matthias.n...@igd.fraunhofer.de>;
mitk-users@lists.sourceforge.net
Subject: RE: Mitk Layout to Big3D at plugin start.
Hi Matthias,
We increased the decoupling between plugins and editors as not everyone is
using the StdMultiWidgetEditor, and having hard dependencies here is very
troublesome for these kinds of scenarios. I guess you can cast to [1], as it is
the only public class of the plugin and it derives from
ILinkedRenderWindowPart. So try to cast your IRenderWindowPart to this one.
Best,
Stefan
[1]
https://github.com/MITK/MITK/blob/master/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/QmitkStdMultiWidgetEditor.h
From: Noll, Matthias [mailto:matthias.n...@igd.fraunhofer.de]
Sent: Dienstag, 23. Mai 2017 10:56
To: mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>
Subject: [mitk-users] Mitk Layout to Big3D at plugin start.
Hi all,
I like to start my plugin with only the 3D render window active. In an older
version of MITK it was possible through the StdMultiWidget by simply calling
the function changeLayoutToBig3D() e.g. in the plugins' CreateQtPartControl()
function.
How can I achieve this now? There are no functions in the IRenderWindowPart to
do this.
In the mailing list, Sasha suggested in 2015 to add the plugin dependency to
org.mitk.gui.qt.stdmultiwidgeteditor and dynamic_cast the interface. I don't
get what interface I need to cast to which class...
This all seems a bit complicated to achieve such a tiny little change. If the
user can do it by clicking the QWindowRenderMenu buttons, why can't we do it
easily from code. I don't think only having one view active on plugin start is
such an uncommon use case.
Anyway, any help would be appreciated.
Best regards,
Matthias
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users