Remove actors from views

This commit is contained in:
eap 2012-11-20 10:47:47 +00:00
parent 1ed6f15ecf
commit 58311e9176
2 changed files with 12 additions and 1 deletions

View File

@ -210,7 +210,7 @@ bool SMESHGUI_DeleteGroupDlg::onApply()
QList<SMESH::SMESH_GroupBase_var>::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() );
}
}

View File

@ -29,6 +29,8 @@
// SMESH includes
#include "SMESH_SMESHGUI.hxx"
#include <SALOME_ListIO.hxx>
// Qt includes
#include <QDialog>
@ -86,6 +88,7 @@ private:
SMESHGUI* mySMESHGUI;
LightApp_SelectionMgr* mySelectionMgr;
SALOME_ListIO myListGrpIO;
QList<SMESH::SMESH_GroupBase_var> myListGrp;
bool myBlockSelection;