#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Study.h>
+#include <SalomeApp_Notebook.h>
#include <SUIT_OverrideCursor.h>
#include <LightApp_Application.h>
//=================================================================================
SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
: QDialog(SMESH::GetDesktop(theModule)),
+ SMESHGUI_Helper(theModule),
mySMESHGUI(theModule),
mySelectionMgr(SMESH::GetSelectionMgr(theModule))
{
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();
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;
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));
}
}
//=================================================================================
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;
}