X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_HypothesesUtils.cxx;h=5d47d4c1909a8611f20996ffaacb06e9c9a0f65e;hp=323b1ec6815f28dd28af0c74a3e8fd3f52e8d11c;hb=85332362ed87110b788afa215a9bc8e02a160fea;hpb=e4737e85f0da6d3f90fd08f6be1c2825195fe16f;ds=sidebyside diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 323b1ec68..5d47d4c19 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -376,7 +376,9 @@ namespace SMESH{ if ( !aMesh->_is_nil() && !SsubM->_is_nil() && !aShapeObject->_is_nil() ) { res = aMesh->AddHypothesis( aShapeObject, aHyp ); if ( res < SMESH::HYP_UNKNOWN_FATAL ) { - SMESH::ModifiedMesh( SsubM, false ); + SALOMEDS::SObject_var meshSO = SMESH::FindSObject( aMesh ); + if ( !meshSO->_is_nil() ) + SMESH::ModifiedMesh( meshSO, false ); } if ( res > SMESH::HYP_OK ) { wc.stop(); @@ -429,8 +431,11 @@ namespace SMESH{ if (!aMesh->_is_nil()) { res = aMesh->RemoveHypothesis(aShape, anHyp); - if ( res < SMESH::HYP_UNKNOWN_FATAL ) - SMESH::ModifiedMesh(MorSM, false); + if ( res < SMESH::HYP_UNKNOWN_FATAL ) { + SALOMEDS::SObject_var meshSO = SMESH::FindSObject( aMesh ); + if ( !meshSO->_is_nil() ) + SMESH::ModifiedMesh(meshSO, false); + } if ( res > SMESH::HYP_OK ) { wc.stop(); processHypothesisStatus( res, anHyp, false ); @@ -439,32 +444,6 @@ namespace SMESH{ } } } - - SALOMEDS::SObject_var aHypSObj = aStudy->FindObjectID(IObject->getReference()); - if (!aHypSObj->_is_nil()) { - SALOMEDS::SObject_var MorSM = SMESH::GetMeshOrSubmesh(aHypSObj); - if (!MorSM->_is_nil()) { - GEOM::GEOM_Object_var aShapeObject =SMESH::GetShapeOnMeshOrSubMesh(MorSM); - if (!aShapeObject->_is_nil()){ - SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface(MorSM); - SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface(MorSM); - - if (!aSubMesh->_is_nil()) - aMesh = aSubMesh->GetFather(); - - if (!aMesh->_is_nil()) { - res = aMesh->RemoveHypothesis(aShapeObject, anHyp); - if ( res < SMESH::HYP_UNKNOWN_FATAL ) - SMESH::ModifiedMesh(MorSM, false); - if ( res > SMESH::HYP_OK ) { - wc.stop(); - processHypothesisStatus( res, anHyp, false ); - wc.start(); - } - } - } - } - } } } catch( const SALOME::SALOME_Exception& S_ex ) { @@ -500,8 +479,11 @@ namespace SMESH{ if (!aMesh->_is_nil()) { res = aMesh->RemoveHypothesis(aShapeObject, anHyp); - if ( res < SMESH::HYP_UNKNOWN_FATAL ) - SMESH::ModifiedMesh(MorSM, false); + if ( res < SMESH::HYP_UNKNOWN_FATAL ) { + SALOMEDS::SObject_var meshSO = SMESH::FindSObject( aMesh ); + if ( !meshSO->_is_nil() ) + SMESH::ModifiedMesh(meshSO, false); + } if ( res > SMESH::HYP_OK ) { wc.stop(); processHypothesisStatus( res, anHyp, false );