[Bug SMESH4598] Crash of the session when compute and update are not done in the same view. Bug fixed.

This commit is contained in:
jrt 2003-12-11 09:51:27 +00:00
parent 0aec6215ad
commit 76ffafd784

View File

@ -2202,7 +2202,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop * parent)
Standard_Boolean res; Standard_Boolean res;
SMESH_Actor *ac = SMESH_Actor *ac =
smeshGUI->FindActorByEntry(IObject->getEntry(), res, smeshGUI->FindActorByEntry(IObject->getEntry(), res,
true); false);
if (res) if (res)
{ {
smeshGUI->DisplayActor(ac, true); smeshGUI->DisplayActor(ac, true);
@ -4152,6 +4152,11 @@ void SMESHGUI::BuildPresentation(const Handle(SALOME_InteractiveObject) & theIO)
// The actor belongs to inactive view -> create a copy and display it in the active view // The actor belongs to inactive view -> create a copy and display it in the active view
if (!rwInter->isInViewer(IObject)) if (!rwInter->isInViewer(IObject))
{ {
if(ac->GetMapper()==NULL)
{
SMESH::SMESH_Mesh_var aMesh = smeshGUI->ConvertIOinMesh(theIO, res);
ac=smeshGUI->ReadScript(aMesh);
}
SMESH_Actor *acCopy = SMESH_Actor::New(); SMESH_Actor *acCopy = SMESH_Actor::New();
acCopy->ShallowCopy(ac); acCopy->ShallowCopy(ac);
ac = acCopy; ac = acCopy;
@ -4200,7 +4205,7 @@ SMESH_Actor *SMESHGUI::ReadScript(SMESH::SMESH_Mesh_ptr aMesh)
if (!aMesh->_is_nil()) if (!aMesh->_is_nil())
{ {
Standard_Boolean result; Standard_Boolean result;
MeshActor = FindActor(aMesh, result, true); MeshActor = FindActor(aMesh, result, false);
if (result) if (result)
{ {
SMESH::log_array_var aSeq = aMesh->GetLog(true); SMESH::log_array_var aSeq = aMesh->GetLog(true);
@ -6052,15 +6057,15 @@ void SMESHGUI::Update(const Handle(SALOME_InteractiveObject) & IO)
getActiveStudyFrame()->getRightFrame()->getViewFrame())-> getActiveStudyFrame()->getRightFrame()->getViewFrame())->
getRWInteractor(); getRWInteractor();
ac = ReadScript(aMesh);
// The actor belongs to inactive view -> create a copy and display it in the active view // The actor belongs to inactive view -> create a copy and display it in the active view
if (!rwInter->isInViewer(IO)) if (!rwInter->isInViewer(IO))
{ {
SMESH_Actor *acCopy = SMESH_Actor::New(); SMESH_Actor *acCopy = SMESH_Actor::New();
acCopy->ShallowCopy(ac); acCopy->ShallowCopy(ac);
ac=acCopy;
smeshGUI->DisplayActor(acCopy, false);
} }
ac = ReadScript(aMesh);
if (ac != NULL) if (ac != NULL)
{ {
#ifdef TRACE #ifdef TRACE