+/*!
+ \brief Shows (toShow = true) or hides ParaView view window
+*/
+void MEDOPModule::showView( bool toShow )
+{
+ LightApp_Application* anApp = getApp();
+ PVViewer_ViewManager* viewMgr =
+ dynamic_cast<PVViewer_ViewManager*>( anApp->getViewManager( PVViewer_Viewer::Type(), false ) );
+ if ( !viewMgr ) {
+ viewMgr = new PVViewer_ViewManager( anApp->activeStudy(), anApp->desktop(), anApp->logWindow() );
+ anApp->addViewManager( viewMgr );
+ connect( viewMgr, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
+ anApp, SLOT( onCloseView( SUIT_ViewManager* ) ) );
+ }
+
+ PVViewer_ViewWindow* pvWnd = dynamic_cast<PVViewer_ViewWindow*>( viewMgr->getActiveView() );
+ if ( !pvWnd ) {
+ pvWnd = dynamic_cast<PVViewer_ViewWindow*>( viewMgr->createViewWindow() );
+ // this also connects to the pvserver and instantiates relevant PV behaviors
+ }
+
+ pvWnd->setShown( toShow );
+ if ( toShow ) pvWnd->setFocus();
+}
+