-
-//=============================================================================
-/*! HypothesisCreator::EditHypothesis
- *
- */
-//=============================================================================
-void StdMeshersGUI_HypothesisCreator::EditHypothesis
- (SMESH::SMESH_Hypothesis_ptr theHyp)
-{
- MESSAGE("StdMeshersGUI_HypothesisCreator::EditHypothesis");
-
- SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis(theHyp);
-
- list<SMESHGUI_aParameterPtr> paramList;
- StdMeshersGUI_Parameters::GetParameters( theHyp, paramList );
-
- bool modified = false;
- if ( SMESHGUI_aParameterDlg::Parameters( SMESHGUI::GetSMESHGUI(), paramList, QObject::tr("SMESH_VALUE")) )
- modified = StdMeshersGUI_Parameters::SetParameters( theHyp, paramList );
-
- if ( modified ) {
- //set new Attribute Comment for hypothesis which parameters were modified
- QString aParams = "";
- StdMeshersGUI_Parameters::GetParameters( theHyp, paramList, aParams );
- _PTR(SObject) SHyp = SMESH::FindSObject(theHyp);
- if (SHyp)
- if (!aParams.isEmpty()) {
- SMESH::SetValue(SHyp, aParams);
- //mySMESHGUI->GetActiveStudy()->updateObjBrowser(true);
- }
-
- 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);
- }
- }
-}
-
-//=============================================================================
-/*! GetHypothesisCreator
- *
- */
-//=============================================================================
-extern "C"
-{
- SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator
- (QString aHypType, QString aServerLibName, SMESHGUI* aSMESHGUI)
- {
- return new StdMeshersGUI_HypothesisCreator
- (aHypType, aServerLibName, aSMESHGUI);
- }
-}