X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_BuildCompoundDlg.cxx;h=13535fe369f42b5d74e628fec49bb26790b6bdfb;hp=3ec453d0b21ffcd44e71f58bfd9f1eba7b00f6a7;hb=333415e6c9f744a167d1779d9e74e073f122e88c;hpb=00ee13aec2a8c5cb48335d7a62ff3699e542c103 diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx index 3ec453d0b..13535fe36 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -72,6 +73,7 @@ //================================================================================= SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule ) : QDialog(SMESH::GetDesktop(theModule)), + SMESHGUI_Helper(theModule), mySMESHGUI(theModule), mySelectionMgr(SMESH::GetSelectionMgr(theModule)) { @@ -289,27 +291,27 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() if (!isValid()) return false; + SMESH::SMESH_Mesh_var aCompoundMesh; + if (!myMesh->_is_nil()) { - QStringList aParameters; - aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" ")); - try { + try { SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); // concatenate meshes - SMESH::SMESH_Mesh_var aCompoundMesh; if(CheckBoxCommon->isChecked()) - aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray, - !(ComboBoxUnion->currentIndex()), - CheckBoxMerge->isChecked(), - SpinBoxTol->GetValue()); + aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray, + !(ComboBoxUnion->currentIndex()), + CheckBoxMerge->isChecked(), + SpinBoxTol->GetValue()); else - aCompoundMesh = aSMESHGen->Concatenate(myMeshArray, - !(ComboBoxUnion->currentIndex()), - CheckBoxMerge->isChecked(), - SpinBoxTol->GetValue()); + aCompoundMesh = aSMESHGen->Concatenate(myMeshArray, + !(ComboBoxUnion->currentIndex()), + CheckBoxMerge->isChecked(), + SpinBoxTol->GetValue()); - aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if( CheckBoxMerge->isChecked() ) + getNotebook()->setParameters( aCompoundMesh, 1, SpinBoxTol ); SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text() ); mySMESHGUI->updateObjBrowser(); @@ -319,8 +321,16 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() LineEditName->setText(GetDefaultName(tr("COMPOUND_MESH"))); - //mySelectionMgr->clearSelected(); - SMESH::UpdateView(); + // IPAL21468 Compound is hidden after creation. + if ( SMESHGUI::automaticUpdate() ) { + mySelectionMgr->clearSelected(); + SMESH::UpdateView(); + + _PTR(SObject) aSO = SMESH::FindSObject(aCompoundMesh.in()); + if ( SMESH_Actor* anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str()) ) + SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor); + }// end IPAL21468 + return true; } return false; @@ -360,10 +370,10 @@ void SMESHGUI_BuildCompoundDlg::ClickOnHelp() app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - "application")). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + "application")). + arg(myHelpFileName)); } } @@ -504,17 +514,7 @@ void SMESHGUI_BuildCompoundDlg::onSelectMerge(bool toMerge) //================================================================================= 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; - } + if( CheckBoxMerge->isChecked() ) + return checkParameters( true, 1, SpinBoxTol ); return true; }