From: asv Date: Wed, 10 Aug 2005 06:22:31 +0000 (+0000) Subject: rules for display/erase popup commands changed. Also added code to create a default... X-Git-Tag: T_3_0_2a1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=70a0b4d56ad9c2e26c31f7782e96f8fd3ba3e75e;p=modules%2Fvisu.git rules for display/erase popup commands changed. Also added code to create a default view window on Display command if no window was open. --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 01bcb137..0f7c14a6 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -596,6 +596,9 @@ OnCreateMesh() if (anIO.IsNull() || !anIO->hasEntry()) return; + // create a VTK view window if it does not exist + GetViewWindow( this, /*create=*/true ); + CreateMesh(this, anIO); } @@ -607,6 +610,9 @@ OnCreateManyMesh() if (CheckLock(aStudy)) return; + // create a VTK view window if it does not exist + GetViewWindow( this, /*create=*/true ); + // Get selected SObject SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); SALOME_ListIO aListIO; @@ -693,6 +699,8 @@ OnDisplayPrs() { if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs"); + SVTK_ViewWindow* vw = GetViewWindow( this, /*create=*/true ); + QApplication::setOverrideCursor(Qt::waitCursor); SALOME_ListIO aList; SalomeApp_SelectionMgr* mgr = GetSelectionMgr(this); @@ -708,7 +716,7 @@ OnDisplayPrs() if(aPrsObject){ if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object"); UpdateViewer( this, aPrsObject ); - if (SVTK_ViewWindow* vw = GetViewWindow( this )) { + if ( vw ) { vw->highlight(anIO, 1); } continue; @@ -736,7 +744,7 @@ OnDisplayPrs() } } } - if (SVTK_ViewWindow* vw = GetViewWindow( this )) { + if ( vw ) { vw->getRenderer()->ResetCameraClippingRange(); vw->Repaint(); } @@ -759,8 +767,9 @@ OnErasePrs() QApplication::setOverrideCursor(Qt::waitCursor); - SVTK_ViewWindow* vw = GetViewWindow(this); - if (vw) vw->unHighlightAll(); + SVTK_ViewWindow* vw = GetViewWindow( this ); + if (vw) + vw->unHighlightAll(); SALOME_ListIO aList; SalomeApp_SelectionMgr* mgr = GetSelectionMgr(this); @@ -770,10 +779,11 @@ OnErasePrs() for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) { anIO = it.Value(); CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() ); - ErasePrs(this, anObject, false); + ErasePrs( this, anObject, false ); } - if (vw) vw->Repaint(); + if (vw) + vw->Repaint(); QApplication::restoreOverrideCursor(); } @@ -2469,7 +2479,7 @@ createPopupMenus() ") or (selcount>0 and $type in {'VISU::TMESH' " + aPrsAll + "})"; mgr->setRule( action( VISU_ERASE ), aRule + "and (isVisible=true)", true );// TODO: aRule.arg(" and isVisible=1"), true ); - mgr->setRule( action( VISU_DISPLAY ), aRule + "and (isVisible=false)", true );// TODO: aRule.arg(" and isVisible=0"), true ); + mgr->setRule( action( VISU_DISPLAY ), aRule + "and ((isVisible=false and isActiveView=true) or (isActiveView=false))", true );// TODO: aRule.arg(" and isVisible=0"), true ); mgr->setRule( action( VISU_DISPLAY_ONLY ), aRule, true ); aRule = "selcount>0 and $type in {'VISU::TMESH' " + aPrsAll + "}";