fix PAL8469. Updating the global mesh icon when local hypotheses are edited

This commit is contained in:
eap 2005-03-30 08:04:33 +00:00
parent 19e44ed37c
commit 85332362ed
2 changed files with 24 additions and 33 deletions

View File

@ -376,7 +376,9 @@ namespace SMESH{
if ( !aMesh->_is_nil() && !SsubM->_is_nil() && !aShapeObject->_is_nil() ) { if ( !aMesh->_is_nil() && !SsubM->_is_nil() && !aShapeObject->_is_nil() ) {
res = aMesh->AddHypothesis( aShapeObject, aHyp ); res = aMesh->AddHypothesis( aShapeObject, aHyp );
if ( res < SMESH::HYP_UNKNOWN_FATAL ) { 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 ) { if ( res > SMESH::HYP_OK ) {
wc.stop(); wc.stop();
@ -429,8 +431,11 @@ namespace SMESH{
if (!aMesh->_is_nil()) { if (!aMesh->_is_nil()) {
res = aMesh->RemoveHypothesis(aShape, anHyp); res = aMesh->RemoveHypothesis(aShape, anHyp);
if ( res < SMESH::HYP_UNKNOWN_FATAL ) if ( res < SMESH::HYP_UNKNOWN_FATAL ) {
SMESH::ModifiedMesh(MorSM, false); SALOMEDS::SObject_var meshSO = SMESH::FindSObject( aMesh );
if ( !meshSO->_is_nil() )
SMESH::ModifiedMesh(meshSO, false);
}
if ( res > SMESH::HYP_OK ) { if ( res > SMESH::HYP_OK ) {
wc.stop(); wc.stop();
processHypothesisStatus( res, anHyp, false ); 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<SMESH::SMESH_Mesh>(MorSM);
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>(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 ) { catch( const SALOME::SALOME_Exception& S_ex ) {
@ -500,8 +479,11 @@ namespace SMESH{
if (!aMesh->_is_nil()) { if (!aMesh->_is_nil()) {
res = aMesh->RemoveHypothesis(aShapeObject, anHyp); res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
if ( res < SMESH::HYP_UNKNOWN_FATAL ) if ( res < SMESH::HYP_UNKNOWN_FATAL ) {
SMESH::ModifiedMesh(MorSM, false); SALOMEDS::SObject_var meshSO = SMESH::FindSObject( aMesh );
if ( !meshSO->_is_nil() )
SMESH::ModifiedMesh(meshSO, false);
}
if ( res > SMESH::HYP_OK ) { if ( res > SMESH::HYP_OK ) {
wc.stop(); wc.stop();
processHypothesisStatus( res, anHyp, false ); processHypothesisStatus( res, anHyp, false );

View File

@ -136,8 +136,17 @@ void StdMeshersGUI_HypothesisCreator::EditHypothesis
//mySMESHGUI->GetActiveStudy()->updateObjBrowser(true); //mySMESHGUI->GetActiveStudy()->updateObjBrowser(true);
} }
for (int i=0; i<listSOmesh->length(); i++) if ( listSOmesh->length() > 0 ) {
SMESH::ModifiedMesh(listSOmesh[i], false); SALOMEDS::SObject_var submSO = listSOmesh[0];
SMESH::SMESH_Mesh_var aMesh =
SMESH::SObjectToInterface<SMESH::SMESH_Mesh>(submSO);
SMESH::SMESH_subMesh_var aSubMesh =
SMESH::SObjectToInterface<SMESH::SMESH_subMesh>(submSO);
if ( !aSubMesh->_is_nil() )
aMesh = aSubMesh->GetFather();
SALOMEDS::SObject_var meshSO = SMESH::FindSObject( aMesh );
SMESH::ModifiedMesh( meshSO, false);
}
} }
} }