From 58311e9176ba1c9a6a6a3508963a6ec3f8e8991c Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 20 Nov 2012 10:47:47 +0000 Subject: [PATCH] Remove actors from views --- src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx | 10 +++++++++- src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx index fc44b4f71..7b2c6e27a 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx @@ -210,7 +210,7 @@ bool SMESHGUI_DeleteGroupDlg::onApply() QList::iterator anIter; for (anIter = myListGrp.begin(); anIter != myListGrp.end(); ++anIter) { - SMESH::SMESH_Mesh_ptr aMesh = (*anIter)->GetMesh(); + SMESH::SMESH_Mesh_var aMesh = (*anIter)->GetMesh(); if (!aMesh->_is_nil()) aMesh->RemoveGroupWithContents(*anIter); } @@ -218,6 +218,12 @@ bool SMESHGUI_DeleteGroupDlg::onApply() myListBox->clear(); myListGrp.clear(); mySelectionMgr->clearSelected(); + + /** Erase graphical objects **/ + SALOME_ListIteratorOfListIO anIterIO (myListGrpIO); + for ( ; anIterIO.More(); anIterIO.Next()) + SMESH::RemoveVisualObjectWithActors( anIterIO.Value()->getEntry(), /*fromAllViews=*/true ); + SMESH::UpdateView(); SMESHGUI::Modified(); mySMESHGUI->updateObjBrowser(true); @@ -285,6 +291,7 @@ void SMESHGUI_DeleteGroupDlg::onSelectionDone() return; myListGrp.clear(); + myListGrpIO.Clear(); QStringList aNames; SALOME_ListIO aListIO; @@ -296,6 +303,7 @@ void SMESHGUI_DeleteGroupDlg::onSelectionDone() if (!aGroup->_is_nil()) { aNames.append(aGroup->GetName()); myListGrp.append(aGroup); + myListGrpIO.Append( anIter.Value() ); } } diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h index 48e418417..76f6bd5b0 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h @@ -29,6 +29,8 @@ // SMESH includes #include "SMESH_SMESHGUI.hxx" +#include + // Qt includes #include @@ -86,6 +88,7 @@ private: SMESHGUI* mySMESHGUI; LightApp_SelectionMgr* mySelectionMgr; + SALOME_ListIO myListGrpIO; QList myListGrp; bool myBlockSelection; -- 2.39.2