Hi,
I think I just found the spot where the MultiWidget is opened manually!
QmitkDataManagerView::GlobalReinit is calling
 
  if (renderWindow == NULL)
    renderWindow = this->OpenRenderWindowPart(false);
 
As I don't have DataManager active in my perspective the code doesn't get called.
 
But actially the following code also does the initialization.
 
  //initialize the view
  mitk::IRenderWindowPart* render_winow_part = this->GetRenderWindowPart(QmitkAbstractView::OPEN);
  //show 3D render window in full screen mode
  QmitkRenderWindow* render_window_3d = render_winow_part->GetQmitkRenderWindow("3d");
  render_window_3d->FullScreenMode(true);
  render_winow_part->GetRenderingManager()->InitializeViews();
  //disable the crosshairs
  mitk::ILinkedRenderWindowPart* linked_render_window_part = dynamic_cast<mitk::ILinkedRenderWindowPart*>(this->GetRenderWindowPart());
  if (linked_render_window_part != nullptr){
      linked_render_window_part->EnableSlicingPlanes(false);
  }
 
 
By the way (there is always a question behind an answer):
What is the best way to change layouts of  QmitkStdMultiWidget ( e.g. Big3D / coronal left, 3D right / ...) from within a plugin?
 
 
Thanks again,
;) Ingmar
 
Gesendet: Donnerstag, 30. Juli 2015 um 13:39 Uhr
Von: "Ingmar Wegner" <iweg...@gmx.de>
An: "Sascha Zelzer" <s.zel...@dkfz-heidelberg.de>
Cc: "Mitk Users" <mitk-users@lists.sourceforge.net>
Betreff: Re: [mitk-users] Enhanced workbench customization from within a perspective
Hi Sascha,
thank you for the answer.

I didn't find the spot where a QmitkStdMultiWidgetEditor instance is manually created in case there is none, but I will keep on looking.
I was concentrating on the fullscreen feature for a special perspective and did the following:

In my workbench window advisor I was building up the GUI elemets that I wanted to hide in fullscreen (menubar, status bar, extension icons etc.).
I added a ShowFullscreen() method that toggled the visibility property of the Qt objects. Then I have a PerspectiveListener class that derives from IPerspectiveListener with a method PerspectiveActivated(). On statup the method gets called before the QT objects are initialized so I can't set the visibility yet. I use a flag to store fullscreen on / off state. Then in PostWindowCreate I build up those objects and call ShowFullscreen() with that flag in the end. Works fine.
When the user changes to a different perspective, PerspectiveActivated gets called again and in case my special perspective is to be activated ShowFullscreen() with true or false is called setting the desired mode.

So the solution was the PerspectiveActivated() method that I first didn't see because it wasn't called due to a false declaration. The interface has changed during the Qt-ification of the berry classes. My fault! I didn't see the warning because of many many itk warnings. (I have to #pragma them away...)

Thanks again,
Ingmar

---------------------------
Hi Sascha,
thank you for the answer.
I didn't find the spot where the MITK Workbench which opens a QmitkStdMultiWidgetEditor instance if there is none and and e.g.

Gesendet: Dienstag, 28. Juli 2015 um 22:09 Uhr
Von: "Sascha Zelzer" <s.zel...@dkfz-heidelberg.de>
An: "Ingmar Wegner" <iweg...@gmx.de>, "Mitk Users" <mitk-users@lists.sourceforge.net>
Betreff: Re: [mitk-users] Enhanced workbench customization from within a perspective

Hi,

On 07/22/2015 03:05 PM, Ingmar Wegner wrote:

Hi community,
I am currently implementing a new perspective with which I want to strip down the GUI as much as possible; similar to a full screen mode.
 
So only to show a plugin X and the QmitkStdMultiWidget. The approptiate terms for BlueBerry application framework would be a view and an editor.
I have found the following explanation great: http://docs.mitk.org/2015.05/AddFunctionality.html
(Some code snippets on QmitkDicomExternalDataWidget are not shown in the webpage!)
 
I already have the additional perspective in place and when I activate it it shows my plugin X.
However when I restart the application it starts the perspective again but doesn't show the StdMultiWidget! It remains white, the space is reserved for it though.
I didn't find a way to hook into the loading process during a restart.
Any hints on that?
If I remember correctly, restoring editors from previous sessions is not fully functional yet (as you experienced).
 

 
As I want to have a full screen I need a way to get back to regular perspective so I added a button to the plugin X with :
 
    // Switch to default perspective.
    QString perspective_id = "my.workbench.app.perspective";
    berry::IWorkbenchWindow::Pointer window = this->GetSite()->GetWorkbenchWindow();
    window->GetWorkbench()->ShowPerspective(perspective_id, berry::IWorkbenchWindow::Pointer(window));
    mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 
This works great and with the latter RequestUpdateAll the perspective looks good again.
So maybe this is what is missing?
But I don't have a hook to call it! CreateInitialLayout is only called when the perspective is explicitly triggered, not loaded during startup because it was activated when the app was closed.
There are hooks for perspective activation etc. but it is probably not the best way to do what you want. I think there is some logic hidden in the MITK Workbench which opens a QmitkStdMultiWidgetEditor instance if there is none and and e.g. a request update all is triggered (something along these lines).

The complication with restoring editors is that they need an "input" to be useful. The input for the multi widget is the data storage, which on startup usually is empty (except if you start the workbench with some command line args) so restoring the editor doesn't make much sense if it will be empty anyways.
 

 
Then I have to hide the menu bar, status bar and so on. So whenever the perspective is activated I want to strip down the GUI.
Is there a way to recall PostWindowCreate() and to give it a different configurer with the parameters what to show?
I don't have a connection between perspective and the workbench window advisor, do I?
Window advisors are one time hooks and cannot be triggered again for an existing window.

I have a different proposal: Make the container widget which holds the views and editors (excluding menu and tool bars etc.) full screen, using Qt methods (reparenting it, setting the correct window flags, etc.). You could probably even have a floating/hovering "leave fullscreen" button. One complication could be the part activation logic, which is triggered through a global event filter on the QApplication instance, but this need to be tried out.

This could be implemented in a separate plug-in for any application and perspective.

Cheers,
Sascha
 

 
Ther once was a fullscreen mode but I didn't find it. Any one also requesting something similar?
 
;),
Ingmar
 
 

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

Reply via email to