+ bool res = result==QDialog::Accepted;
+ if( res )
+ {
+ /*QString paramValues = */storeParams();
+ // No longer needed since NoteBook appears and "Value" OB field shows names of variable
+// if ( !paramValues.isEmpty() ) {
+// if ( _PTR(SObject) SHyp = SMESH::FindSObject( myHypo ))
+// SMESH::SetValue( SHyp, paramValues );
+// }
+ }
+
+ changeWidgets().clear();
+
+ if( myIsCreate && !res )
+ {
+ //remove just created hypothesis
+ _PTR(SObject) aHypSObject = SMESH::FindSObject( myHypo );
+ _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ if( aStudy && !aStudy->GetProperties()->IsLocked() )
+ {
+ _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+ aBuilder->RemoveObjectWithChildren( aHypSObject );
+ }
+ }
+ else if( !myIsCreate && res )
+ {
+ SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( myHypo );
+ if( listSOmesh.size() > 0 )
+ for( int i = 0; i < listSOmesh.size(); i++ )
+ {
+ _PTR(SObject) submSO = listSOmesh[i];
+ 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, aMesh->NbNodes()==0);
+ }
+ }
+ SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
+ myHypo = SMESH::SMESH_Hypothesis::_nil();
+ myInitParamsHypo = SMESH::SMESH_Hypothesis::_nil();
+
+ disconnect( myDlg, SIGNAL( finished( int ) ), this, SLOT( onDialogFinished( int ) ) );
+ myDlg->close();
+ //delete myDlg;
+ myDlg = 0;
+ emit finished( result );