X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshersGUI%2FStdMeshersGUI.cxx;h=fa48527deebd38095f1681559cb3dfb86c824536;hb=1d0ad233cfb9576030f41a0d04ab46f33eaab17e;hp=8682545d6aec28b2586667f57157ffa73f79561c;hpb=e4737e85f0da6d3f90fd08f6be1c2825195fe16f;p=modules%2Fsmesh.git diff --git a/src/StdMeshersGUI/StdMeshersGUI.cxx b/src/StdMeshersGUI/StdMeshersGUI.cxx index 8682545d6..fa48527de 100644 --- a/src/StdMeshersGUI/StdMeshersGUI.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI.cxx @@ -37,8 +37,10 @@ #include "StdMeshersGUI_Parameters.h" #include "StdMeshersGUI_CreateStdHypothesisDlg.h" -#include "QAD_Desktop.h" -#include "QAD_ResourceMgr.h" +#include "SUIT_Desktop.h" +#include "SUIT_ResourceMgr.h" + +#include #include @@ -97,9 +99,16 @@ void StdMeshersGUI_HypothesisCreator::CreateHypothesis else { if ( StdMeshersGUI_Parameters::HasParameters( myHypType )) - // Show Dialog for hypothesis creation + { + // Show Dialog for hypothesis creation StdMeshersGUI_CreateStdHypothesisDlg *aDlg = - new StdMeshersGUI_CreateStdHypothesisDlg(myHypType, parent, ""); + new StdMeshersGUI_CreateStdHypothesisDlg(myHypType, parent, ""); + /* Move widget on the botton right corner of main widget */ +// int x, y ; +// mySMESHGUI->DefineDlgPosition( aDlg, x, y ) ; +// aDlg->move( x, y ) ; + aDlg->exec() ; /* displays Dialog */ + } else SMESH::CreateHypothesis(myHypType, aHypName, isAlgo); // without GUI } @@ -115,29 +124,47 @@ void StdMeshersGUI_HypothesisCreator::EditHypothesis { MESSAGE("StdMeshersGUI_HypothesisCreator::EditHypothesis"); - SALOMEDS::Study::ListOfSObject_var listSOmesh = - SMESH::GetMeshesUsingAlgoOrHypothesis(theHyp); - + SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis(theHyp); + list paramList; StdMeshersGUI_Parameters::GetParameters( theHyp, paramList ); bool modified = false; - if ( SMESHGUI_aParameterDlg::Parameters( paramList, QObject::tr("SMESH_VALUE")) ) - modified = StdMeshersGUI_Parameters::SetParameters( theHyp, paramList ); + if ( SMESHGUI_aParameterDlg::Parameters( SMESHGUI::GetSMESHGUI(), paramList, QObject::tr("SMESH_VALUE")) ) + { + try + { + modified = StdMeshersGUI_Parameters::SetParameters( theHyp, paramList ); + } + catch (const SALOME::SALOME_Exception& S_ex) + { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + return; + } + } if ( modified ) { //set new Attribute Comment for hypothesis which parameters were modified QString aParams = ""; StdMeshersGUI_Parameters::GetParameters( theHyp, paramList, aParams ); - SALOMEDS::SObject_var SHyp = SMESH::FindSObject(theHyp); - if (!SHyp->_is_nil()) + _PTR(SObject) SHyp = SMESH::FindSObject(theHyp); + if (SHyp) if (!aParams.isEmpty()) { SMESH::SetValue(SHyp, aParams); //mySMESHGUI->GetActiveStudy()->updateObjBrowser(true); } - - for (int i=0; ilength(); i++) - SMESH::ModifiedMesh(listSOmesh[i], false); + + if ( listSOmesh.size() > 0 ) { + _PTR(SObject) submSO = listSOmesh[0]; + SMESH::SMESH_Mesh_var aMesh = + SMESH::SObjectToInterface(submSO); + SMESH::SMESH_subMesh_var aSubMesh = + SMESH::SObjectToInterface(submSO); + if ( !aSubMesh->_is_nil() ) + aMesh = aSubMesh->GetFather(); + _PTR(SObject) meshSO = SMESH::FindSObject( aMesh ); + SMESH::ModifiedMesh( meshSO, false); + } } }