+/*!
+ \brief SLOT called when Generate button is clicked
+*/
+void SMESHGUI_DuplicateNodesDlg::onGenerate()
+{
+ if ( SMESHGUI::isStudyLocked() )
+ return;
+
+ SUIT_OverrideCursor aWaitCursor;
+ BusyLocker lock( myBusy );
+
+ try {
+ SMESH::SMESH_Mesh_var aMesh = myGroups1[0]->GetMesh();
+ SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor();
+
+ SMESH::ListOfGroups_var g1 = new SMESH::ListOfGroups();
+ g1->length( myGroups1.count() );
+ for ( int i = 0; i < myGroups1.count(); i++ )
+ g1[i] = myGroups1[i];
+ SMESH::ListOfGroups_var g2 = new SMESH::ListOfGroups();
+ g2->length( myGroups2.count() );
+ for ( int i = 0; i < myGroups2.count(); i++ )
+ g2[i] = myGroups2[i];
+
+ SMESH::ListOfGroups_var newGroups =
+ aMeshEditor->AffectedElemGroupsInRegion( g1, g2, GEOM::GEOM_Object::_nil() );
+
+ QString text;
+ switch ( newGroups->length() ) {
+ case 0: break;
+ case 1: text = SMESH::toQStr( newGroups[0]->GetName() ); break;
+ default: text = tr( "SMESH_OBJECTS_SELECTED" ).arg( newGroups->length() );
+ }
+ myLineEdit3->setText( text );
+
+ myGroups3.clear();
+ for ( CORBA::ULong i = 0; i < newGroups->length(); ++i )
+ myGroups3 << SMESH::SMESH_GroupBase::_duplicate( newGroups[i] );
+ }
+ catch (const SALOME::SALOME_Exception& S_ex) {
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ }
+ catch ( const std::exception& exc ) {
+ INFOS( "Follow exception was caught:\n\t" << exc.what() );
+ }
+ catch (...) {
+ INFOS( "Unknown exception was caught !!!" );
+ }
+
+ mySMESHGUI->updateObjBrowser(true);
+ updateButtons();
+}
+