From: apo Date: Wed, 7 Sep 2005 11:49:54 +0000 (+0000) Subject: To customize popup actions X-Git-Tag: BR-D5-38-2003_D2005-12-09~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2644081e2c61f6a5f93111481d18bb586f24357b;p=modules%2Fvisu.git To customize popup actions --- diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 5631b2de..065c23b2 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -484,8 +484,8 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module:: -OnEditGaussPoints() +VisuGUI_Module +::OnEditGaussPoints() { Handle(SALOME_InteractiveObject) anIO; if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ @@ -499,8 +499,8 @@ OnEditGaussPoints() //--------------------------------------------------------------- void -VisuGUI_Module:: -OnDisplayPrs() +VisuGUI_Module +::OnDisplayPrs() { if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs"); @@ -571,8 +571,35 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module:: -OnErasePrs() +VisuGUI_Module +::OnDisplayOnlyPrs() +{ + if(SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this)){ + SALOME_ListIO aList; + aSelectionMgr->selectedObjects(aList); + for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){ + Handle(SALOME_InteractiveObject) anIO = it.Value(); + CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() ); + + if(!CORBA::is_nil(anObject)){ + if(VISU::Prs3d_i* aPrs3d = dynamic_cast(VISU::GetServant(anObject).in())){ + if(aPrs3d->GetType() != VISU::TGAUSSPOINTS) + VISU::OnEraseAll(this); + else + VISU::OnEraseAll(this); + break; + } + } + } + } + OnDisplayPrs(); +} + + +//--------------------------------------------------------------- +void +VisuGUI_Module +::OnErasePrs() { QApplication::setOverrideCursor(Qt::waitCursor); diff --git a/src/VISUGUI/VisuGUI_Module.h b/src/VISUGUI/VisuGUI_Module.h index ee821526..3bb7787f 100644 --- a/src/VISUGUI/VisuGUI_Module.h +++ b/src/VISUGUI/VisuGUI_Module.h @@ -109,6 +109,10 @@ protected slots: void OnDisplayPrs(); + virtual + void + OnDisplayOnlyPrs(); + virtual void OnEraseAll();