Salome HOME
Update copyright information
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_BuildCompoundDlg.cxx
index 73efb4e4a6cf7fbeb4fe7b087e9795965d8ae6a1..0e1b3f250518aef07a804254c1495f712841a424 100644 (file)
@@ -1,29 +1,29 @@
-// SMESH SMESHGUI : GUI for SMESH component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is free software; you can redistribute it and/or 
-// modify it under the terms of the GNU Lesser General Public 
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License. 
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// This library is distributed in the hope that it will be useful, 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details. 
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public 
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+// SMESH SMESHGUI : GUI for SMESH component
 // File   : SMESHGUI_BuildCompoundDlg.cxx
 // Author : Alexander KOVALEV, Open CASCADE S.A.S.
-//
-
 // SMESH includes
+//
 #include "SMESHGUI_BuildCompoundDlg.h"
 
 #include "SMESHGUI.h"
@@ -39,6 +39,8 @@
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <SalomeApp_Study.h>
+#include <SUIT_OverrideCursor.h>
+
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 #include <SALOME_ListIO.hxx>
@@ -121,27 +123,31 @@ SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
   TextLabelMeshes = new QLabel(tr("MESHES"), GroupArgs);
   SelectButton = new QPushButton(GroupArgs);
   SelectButton->setIcon(image1);
+  SelectButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
   LineEditMeshes = new QLineEdit(GroupArgs);
   LineEditMeshes->setReadOnly(true);
 
   TextLabelUnion = new QLabel(tr("PROCESSING_IDENTICAL_GROUPS"), GroupArgs);
   ComboBoxUnion = new QComboBox(GroupArgs);
 
+  CheckBoxCommon = new QCheckBox(tr("CREATE_COMMON_GROUPS"), GroupArgs);
+
   CheckBoxMerge = new QCheckBox(tr("MERGE_NODES_AND_ELEMENTS"), GroupArgs);
 
   TextLabelTol = new QLabel(tr("SMESH_TOLERANCE"), GroupArgs);
   TextLabelTol->setAlignment(Qt::AlignCenter);
   SpinBoxTol = new SMESHGUI_SpinBox(GroupArgs);
-  SpinBoxTol->RangeStepAndValidator(0.0, COORD_MAX, 0.1, 6);
+  SpinBoxTol->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, 6);
 
   GroupArgsLayout->addWidget(TextLabelMeshes, 0, 0);
   GroupArgsLayout->addWidget(SelectButton,    0, 1);
   GroupArgsLayout->addWidget(LineEditMeshes,  0, 2, 1, 2);
   GroupArgsLayout->addWidget(TextLabelUnion,  1, 0, 1, 3); 
   GroupArgsLayout->addWidget(ComboBoxUnion,   1, 3);
-  GroupArgsLayout->addWidget(CheckBoxMerge,   2, 0, 1, 4);
-  GroupArgsLayout->addWidget(TextLabelTol,    3, 0, 1, 2);
-  GroupArgsLayout->addWidget(SpinBoxTol,      3, 2, 1, 2);
+  GroupArgsLayout->addWidget(CheckBoxCommon,  2, 0, 1, 4);
+  GroupArgsLayout->addWidget(CheckBoxMerge,   3, 0, 1, 4);
+  GroupArgsLayout->addWidget(TextLabelTol,    4, 0, 1, 2);
+  GroupArgsLayout->addWidget(SpinBoxTol,      4, 2, 1, 2);
 
   /***************************************************************/
   GroupButtons = new QGroupBox(this);
@@ -149,7 +155,7 @@ SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
   GroupButtonsLayout->setSpacing(SPACING);
   GroupButtonsLayout->setMargin(MARGIN);
 
-  buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+  buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
   buttonOk->setAutoDefault(true);
   buttonOk->setDefault(true);
   buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
@@ -281,18 +287,23 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
     return false;
   if (!myMesh->_is_nil()) {
     try        {
-      QApplication::setOverrideCursor(Qt::WaitCursor);
-      
+      SUIT_OverrideCursor aWaitCursor;
+
       SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
       // concatenate meshes
-      SMESH::SMESH_Mesh_var aCompoundMesh = 
-       aSMESHGen->Concatenate(myMeshArray, 
-                              !(ComboBoxUnion->currentIndex()), 
-                              CheckBoxMerge->isChecked(), 
-                              SpinBoxTol->GetValue());
-      
+      SMESH::SMESH_Mesh_var aCompoundMesh;
+      if(CheckBoxCommon->isChecked())
+       aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray, 
+                                                        !(ComboBoxUnion->currentIndex()), 
+                                                        CheckBoxMerge->isChecked(), 
+                                                        SpinBoxTol->GetValue());
+      else
+       aCompoundMesh = aSMESHGen->Concatenate(myMeshArray, 
+                                              !(ComboBoxUnion->currentIndex()), 
+                                              CheckBoxMerge->isChecked(), 
+                                              SpinBoxTol->GetValue());
+     
       SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text() );
-      QApplication::restoreOverrideCursor();
       mySMESHGUI->updateObjBrowser();
     } catch(...) {
       return false;