#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 <SalomeApp_Tools.h>
#include <qobject.h>
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
}
{
MESSAGE("StdMeshersGUI_HypothesisCreator::EditHypothesis");
- SALOMEDS::Study::ListOfSObject_var listSOmesh =
- SMESH::GetMeshesUsingAlgoOrHypothesis(theHyp);
-
+ SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis(theHyp);
+
list<SMESHGUI_aParameterPtr> 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; i<listSOmesh->length(); i++)
- SMESH::ModifiedMesh(listSOmesh[i], false);
+
+ if ( listSOmesh.size() > 0 ) {
+ _PTR(SObject) 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();
+ _PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
+ SMESH::ModifiedMesh( meshSO, false);
+ }
}
}