SALOME Forum bug: sub-mesh removal leads to an Exception in a re-opened study.

1) call myFilterDlg->UnRegisterFilters();
2) re-create an actor after converting a group to standalone as a
CORBA object becomes different from that held by the actor
This commit is contained in:
eap 2013-07-22 14:35:30 +00:00
parent 6a8e2f83ff
commit 997c16d89d

View File

@ -38,7 +38,7 @@
#include <SMESH_TypeFilter.hxx> #include <SMESH_TypeFilter.hxx>
#include <SMESH_Actor.h> #include <SMESH_Actor.h>
#include <SMESH_ActorUtils.h> //#include <SMESH_ActorUtils.h>
#include <SMESH_LogicalFilter.hxx> #include <SMESH_LogicalFilter.hxx>
// SALOME GEOM includes // SALOME GEOM includes
@ -921,7 +921,7 @@ bool SMESHGUI_GroupDlg::onApply()
QStringList anEntryList; QStringList anEntryList;
SMESH::SMESH_GroupBase_var resultGroup; SMESH::SMESH_GroupBase_var resultGroup;
bool isCreation; bool isCreation, isConversion = false;
if (myGrpTypeId == 0) // standalone if (myGrpTypeId == 0) // standalone
{ {
@ -942,6 +942,7 @@ bool SMESHGUI_GroupDlg::onApply()
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil(); myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil();
isConversion = true;
} }
} }
@ -1150,7 +1151,17 @@ bool SMESHGUI_GroupDlg::onApply()
resultGroup->SetName(myName->text().toLatin1().data()); resultGroup->SetName(myName->text().toLatin1().data());
if ( aMeshGroupSO ) if ( aMeshGroupSO )
{
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) { if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
if ( isConversion ) { // need to reset TVisualObj and actor
Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
SMESH::RemoveVisualObjectWithActors( anIO->getEntry(), true );
SMESH::Update( anIO,true);
myActorsList.clear();
anActor = SMESH::FindActorByEntry( anIO->getEntry() );
if ( !anActor ) return false;
myActorsList.append( anActor );
}
anActor->setName(myName->text().toLatin1().data()); anActor->setName(myName->text().toLatin1().data());
QColor c; QColor c;
int delta; int delta;
@ -1171,6 +1182,7 @@ bool SMESHGUI_GroupDlg::onApply()
} }
} }
} }
}
SMESHGUI::Modified(); SMESHGUI::Modified();
mySMESHGUI->updateObjBrowser(true); mySMESHGUI->updateObjBrowser(true);
SMESH::UpdateView(); // asv: fix of BUG PAL5515 SMESH::UpdateView(); // asv: fix of BUG PAL5515
@ -1193,6 +1205,8 @@ void SMESHGUI_GroupDlg::onOK()
if ( onApply() ) if ( onApply() )
reject(); reject();
setIsApplyAndClose( false ); setIsApplyAndClose( false );
if ( myFilterDlg ) myFilterDlg->UnRegisterFilters();
} }
//================================================================================= //=================================================================================
@ -2202,6 +2216,8 @@ void SMESHGUI_GroupDlg::reject()
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
QDialog::reject(); QDialog::reject();
if ( myFilterDlg ) myFilterDlg->UnRegisterFilters();
} }
//================================================================================= //=================================================================================