From 2644081e2c61f6a5f93111481d18bb586f24357b Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 7 Sep 2005 11:49:54 +0000 Subject: [PATCH] To customize popup actions --- src/VISUGUI/VisuGUI_Module.cxx | 39 ++++++++++++++++++++++++++++------ src/VISUGUI/VisuGUI_Module.h | 4 ++++ 2 files changed, 37 insertions(+), 6 deletions(-) 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(); -- 2.39.2