]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
Salome HOME
Merge from BR_DumpPython_Extension branch (from tag mergeto_BR_V5_Dev_28Jan09)
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_BuildCompoundDlg.cxx
index 0e1b3f250518aef07a804254c1495f712841a424..2d6b7435bfb7dbc0b048ddf0f0a4495e9904e29a 100644 (file)
@@ -285,7 +285,13 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
 {
   if (mySMESHGUI->isActiveStudyLocked())
     return false;
+
+  if (!isValid())
+    return false;
+
   if (!myMesh->_is_nil()) {
+    QStringList aParameters;
+    aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
     try        {
       SUIT_OverrideCursor aWaitCursor;
 
@@ -303,6 +309,8 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
                                               CheckBoxMerge->isChecked(), 
                                               SpinBoxTol->GetValue());
      
+      aCompoundMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+
       SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text() );
       mySMESHGUI->updateObjBrowser();
     } catch(...) {
@@ -483,6 +491,30 @@ void SMESHGUI_BuildCompoundDlg::keyPressEvent( QKeyEvent* e )
 //=================================================================================
 void SMESHGUI_BuildCompoundDlg::onSelectMerge(bool toMerge)
 {
+  
   TextLabelTol->setEnabled(toMerge);
   SpinBoxTol->setEnabled(toMerge);
+  if(!toMerge)
+    SpinBoxTol->SetValue(1e-05);
+}
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool SMESHGUI_BuildCompoundDlg::isValid()
+{
+  QString msg;
+  bool ok=true;
+  if(CheckBoxMerge->isChecked())
+    ok = SpinBoxTol->isValid( msg, true );
+
+  if( !ok ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return false;
+  }
+  return true;
 }