Salome HOME
23081: [CEA 1496] Control merge nodes behaviour: set fixed nodes
authoreap <eap@opencascade.com>
Thu, 24 Sep 2015 16:17:33 +0000 (19:17 +0300)
committereap <eap@opencascade.com>
Thu, 24 Sep 2015 16:17:33 +0000 (19:17 +0300)
Change dlg layout by request of http://salome.mantis.opencascade.com/view.php?id=23081#c20415

25 files changed:
doc/salome/gui/SMESH/images/mergeelems.png [changed mode: 0755->0644]
doc/salome/gui/SMESH/images/mergeelems_auto.png
doc/salome/gui/SMESH/images/mergenodes.png
doc/salome/gui/SMESH/images/mergenodes_auto.png
doc/salome/gui/SMESH/images/merging_nodes1.png
doc/salome/gui/SMESH/images/merging_nodes2.png
doc/salome/gui/SMESH/images/sewing1.png
doc/salome/gui/SMESH/images/sewing2.png [changed mode: 0755->0644]
doc/salome/gui/SMESH/images/sewing3.png [changed mode: 0755->0644]
doc/salome/gui/SMESH/images/sewing4.png [changed mode: 0755->0644]
doc/salome/gui/SMESH/images/sewing_manual.png
doc/salome/gui/SMESH/input/merging_elements.doc
doc/salome/gui/SMESH/input/merging_nodes.doc
src/OBJECT/SMESH_Object.cxx
src/SMDS/SMDS_Mesh.cxx
src/SMDS/SMDS_Mesh0DElement.cxx
src/SMESH/SMESH_MeshEditor.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESHGUI_MergeDlg.cxx
src/SMESHGUI/SMESHGUI_MergeDlg.h
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
src/SMESHGUI/SMESHGUI_SewingDlg.cxx
src/SMESHGUI/SMESH_msg_en.ts
src/SMESHUtils/SMESH_MAT2d.cxx
src/SMESH_I/SMESH_Gen_i_1.cxx

old mode 100755 (executable)
new mode 100644 (file)
index 3f59269..40d614f
Binary files a/doc/salome/gui/SMESH/images/mergeelems.png and b/doc/salome/gui/SMESH/images/mergeelems.png differ
index 904d234637a0af9ad75aa018c4b1f5055e53f20b..6e2b306971de80f9708dec533dfe4063909490cc 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/mergeelems_auto.png and b/doc/salome/gui/SMESH/images/mergeelems_auto.png differ
index ad11a1225017dc6c1bfef6dbb947b8465eb438c6..5b34361cb92541527510a8644626ce88d4b24373 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/mergenodes.png and b/doc/salome/gui/SMESH/images/mergenodes.png differ
index 99ff0d29843425e470ffa901abfc1724cc20f4af..4f177f605fbce3dcea99859915a1fc8e84681e8b 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/mergenodes_auto.png and b/doc/salome/gui/SMESH/images/mergenodes_auto.png differ
index 7913b5eaa8d5b6f6ad6b3a3507e534427d184c8c..05c817537025fc932f43ca6f8835dd5ddbcabb67 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/merging_nodes1.png and b/doc/salome/gui/SMESH/images/merging_nodes1.png differ
index e54b6f099bc9dc8bc6531984c0e7c437a661e9be..862ed17239fec2649a000bf7da57b21046c6829d 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/merging_nodes2.png and b/doc/salome/gui/SMESH/images/merging_nodes2.png differ
index 1e97dd2143ce36c03aa8dcafa1d0ca3bbddc1175..55e0d83343c248b5e756823119c83883c460c47e 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/sewing1.png and b/doc/salome/gui/SMESH/images/sewing1.png differ
old mode 100755 (executable)
new mode 100644 (file)
index b7563f9..2ba3e43
Binary files a/doc/salome/gui/SMESH/images/sewing2.png and b/doc/salome/gui/SMESH/images/sewing2.png differ
old mode 100755 (executable)
new mode 100644 (file)
index da2972f..d2d97d5
Binary files a/doc/salome/gui/SMESH/images/sewing3.png and b/doc/salome/gui/SMESH/images/sewing3.png differ
old mode 100755 (executable)
new mode 100644 (file)
index 748237c..ad66682
Binary files a/doc/salome/gui/SMESH/images/sewing4.png and b/doc/salome/gui/SMESH/images/sewing4.png differ
index ded90cf992c9d1dd6fece85939ff06d11e008fdb..ff125bc1aa9e84677cad3923d6cab19d59fb3f74 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/sewing_manual.png and b/doc/salome/gui/SMESH/images/sewing_manual.png differ
index e5786c0944b60ba3aa9c4b2a940ce0a40b97b6a0..6236ad02bb55d12e90363728726b0adc45494523 100644 (file)
@@ -2,68 +2,62 @@
 
 \page merging_elements_page Merging Elements
 
-\n This functionality allows to merge coincident elements of a mesh
-object selectable in the dialog box. Two elements are considered coincident if they are based on the same set of nodes.
+\n This functionality allows to merge coincident elements of a
+mesh. Two elements are considered coincident if they are based on the
+same set of nodes.
 
 \image html mergeelems_ico.png "Merge elements menu button"
 
-<ol>
-<li>Choose in the main menu \b Modification -> \b Transformation
-  -> <b>Merge elements</b> item. The following dialog box shall
-  appear:</li> 
+To merge elements choose in the main menu \b Modification -> \b Transformation
+-> <b>Merge elements</b> item. The following dialog box shall
+appear:
 
 \image html mergeelems_auto.png
-<br>
-<ul>
-<li>\b Name is the name of the mesh object whose elements will be
-  merged.</li> 
-<li>\b Automatic or \b Manual Mode allows choosing how the elements
-  are processed.
-</ul>
 
-<li><b>Automatic mode:</b>
+In this dialog:
 <ul>
-<li>In the \b Automatic Mode the elements created on the same nodes
-  will be merged.</li> 
-</ul>
-</li>
+  <li>\b Name is the name of the mesh object whose elements will be
+    merged.</li> 
+  <li>\b Automatic or \b Manual Mode allows choosing how the elements
+    are processed. In the \b Automatic Mode all elements created on
+    the same nodes will be merged. In \b Manual mode you can adjust
+    groups of coincident elements detected by the program.
 
-<li>If the \b Manual Mode is selected, additional controls are
-  available:
+    If the \b Manual Mode is selected, additional controls are
+    available:
 
 \image html mergeelems.png
 <br>
 <ul>
-<li>\b Detect button generates the list of coincident elements found
-  in the selected object.</li>
-<li><b>Coincident elements</b> is a list of groups of elements for
-  merging. After the operation all elements of each group will
-  be united into one element. The first element of a group is kept and
-  the others are removed.
-<ul>
-<li>\b Remove button deletes the selected group from the list.</li>
-<li>\b Add button adds to the list a group of elements selected in the
-  viewer with pressed "Shift" key.</li>
-<li><b>Select all</b> check-box selects all groups.</li>
-<li><b>Show double elements IDs</b> check-box shows/hides identifiers of
-  elements of the selected groups in the 3D viewer.</li>
-</ul></li>
-<li><b>Edit selected group</b> list allows editing the selected group:
-<br><br>
-\image html add.png
-<center>adds to the group the elements selected in the viewer.</center>
-<br>
-\image html remove.png
-<center>removes the selected elements from the group.</center>
-<br>
-\image html sort.png
-<center>moves the selected element to the first position in the
-  group in order to keep it in the mesh.</center>
-<br>
-</li>
-<li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li>
+  <li>\b Detect button generates the list of coincident elements found
+    in the selected object.</li>
+  <li><b>Coincident elements</b> is a list of groups of elements for
+    merging. After the operation all elements of each group will
+    be united into one element. The first element of a group is kept and
+    the others are removed.
+  <li>\b Remove button deletes the selected group from the list.</li>
+  <li>\b Add button adds to the list a group of elements selected in the
+    viewer with pressed "Shift" key.</li>
+  <li><b>Select all</b> check-box selects all groups.</li>
+  <li><b>Show double elements IDs</b> check-box shows/hides identifiers of
+    elements of the selected groups in the 3D viewer.</li>
+  <li><b>Edit selected group of coincident elements</b> list allows
+    editing the selected group:
+    <br><br>
+    \image html add.png
+    <center>adds to the group the elements selected in the viewer.</center>
+    <br>
+    \image html remove.png
+    <center>removes the selected elements from the group.</center>
+    <br>
+    \image html sort.png
+    <center>moves the selected element to the first position in the
+      group in order to keep it in the mesh.</center>
+    <br>
+  </li>
+</ul>
+  <li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li>
 </ul>
-</ol>
 
 In this picture you see a triangle which coincides with one of the
 elements of the mesh. After we apply <b>Merge Elements</b> functionality, the
index 31c93f7716b7a1323d027bafd9bb9c5a49940ef7..8aff9aa0944e5c6ba8ebdad16e85d2d47d4a22c9 100644 (file)
@@ -18,54 +18,57 @@ then converted to the single node.
 <ul>
 <li>\b Name is the name of the mesh whose nodes will be merged.</li>
 <li>\b Automatic or \b Manual mode allows choosing how the nodes are
-processed.
+  processed. In \b Manual mode you can adjust groups of coincident nodes
+  detected by the program and/or select any nodes to be merged.</li>
 <li>\b Tolerance is a maximum distance between nodes sufficient for
 merging.</li>
 <li>Activation of <b>No merge of corner and medium nodes of quadratic
     cells</b> check-box prevents merging medium nodes of quadratic
     elements with corner nodes. This check-box is enabled provided
     that the selected mesh includes quadratic elements.</li>
-<li><b>Exclude Groups</b> group box allows to ignore the nodes which
-belong to the specified mesh groups.</li>
-<li><b>Nodes to keep</b> group box allows to specify nodes to keep in
-  the mesh. (By default a node being the first in a group of
-  coincident nodes is kept.) It is possible to either select nodes in
-  the Viewer or select groups of any element type whose nodes will be
-  kept.
-  <ol>
+<li><b>Exclude groups from detection</b> group allows to ignore the
+  nodes which belong to the specified mesh groups. This control is
+  active provided that the mesh includes groups.</li>
+<li><b>Nodes to keep during the merge</b> group allows to specify
+  nodes to keep in the mesh. (By default a node being the first in a
+  group of coincident nodes is kept.) It is possible to either select
+  nodes in the Viewer or select groups of any element type whose nodes
+  will be kept.
+  <ul>
     <li>\a Selection button activates selection of nodes to keep.</li>
-    <li><b>Node IDs</b> button activates selection of nodes in the
+    <li><b>Nodes</b> button activates selection of nodes in the
       Viewer.</li>
-    <li><b>Groups and Sub-meshes</b> button activates selection of
+    <li><b>Groups and sub-meshes</b> button activates selection of
       groups and sub-meshes.</li>
     <li>\b Add button adds selected nodes or groups to the list.</li>
     <li> Nodes or groups selected in the list can be removed using \b
       Remove button.</li>
-  </ol>
+  </ul>
 </li>
 </ul>
 
 <li><b>Automatic mode:</b>
 <br>
 <ul>
-<li>In the \b Automatic Mode all Nodes within the indicated tolerance
-will be merged. The nodes which belong to the groups specified in the
-<b>Exclude Groups</b> will be not taken into account.</li>
+<li>In the \b Automatic Mode all nodes within the indicated tolerance
+will be merged. The nodes which belong to the groups specified in
+<b>Exclude groups from detection</b> will NOT be taken into account.</li>
 </ul>
 </li><br>
 <li> The \b Manual mode gives you full control of what the operation will do.
 In this mode additional controls are available:
 <ul>
-<li>\b Detect button generates the list of coincident nodes for the given
-\b Tolerance.</li>
-<li><b>Coincident nodes</b> is a list of groups of nodes for
-  merging. After the operation all nodes of each group will
-  be united into one node. The first node of a group is kept and
-  the others are removed.
+  <li>\b Detect button generates the list of coincident nodes for the given
+    \b Tolerance.</li>
+  <li><b>Coincident nodes</b> is a list of groups of nodes for
+    merging. Upon \b Apply all nodes of each group will
+    be united into one node. The first node of a group is kept and
+    the others are removed. By default the first node has a lowest ID
+    within the group.
 <ul>
 <li>\b Remove button deletes the selected group from the list.</li>
 <li>\b Add button adds to the list a group of nodes selected in the
-viewer with pressed "Shift" key.</li>
+viewer.</li>
 <li><b>Select all</b> check-box selects all groups.</li>
 <li><b>Show double nodes IDs</b> check-box shows/hides identifiers of
 nodes of selected groups in the 3D viewer.</li>
@@ -75,27 +78,32 @@ nodes of selected groups in the 3D viewer.</li>
 \image html mergenodes.png
 <br>
 </li>
-<li><b>Edit selected group</b> list allows editing the selected
-  group:
-  <br><br>
-  \image html add.png
-  <center>adds to the group the nodes selected in the viewer.</center>
-  <br>
-  \image html remove.png
-  <center>removes from the group the selected nodes.</center>
-  <br>
-  \image html sort.png
-  <center>moves the selected node to the first position in the
-    group in order to keep it in the mesh.</center><br>
-</li>
+  <li><b>Edit selected group of coincident nodes</b> list allows
+  editing the selected group:
+    <br><br>
+    \image html add.png
+    <center>adds to the group the nodes selected in the viewer.</center>
+    <br>
+    \image html remove.png
+    <center>removes from the group the selected nodes.</center>
+    <br>
+    \image html sort.png
+    <center>moves the selected node to the first position in the
+      group in order to keep it in the mesh.</center><br>
+  </li>
 </ul>
 </li>
 <li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li>
 </ol>
 
-\image html merging_nodes1.png "The initial object"
-
-\image html merging_nodes2.png "The object has been merged"
+\image html merging_nodes1.png 
+<center> The initial object. Nodes 25, 26 and 5 are added to <b>Nodes
+    to keep during the merge</b> group.
+</center>
+<br>
+\image html merging_nodes2.png
+<center> The object has been merged
+</center>
 
 <br><b>See Also</b> a sample TUI Script of a 
 \ref tui_merging_nodes "Merge Nodes" operation.  
index 1767ddf37aea235c507d102de4d7b11d6c02a3b0..a8d9f780e927a6c0dcf55422111bf5a944422d8a 100644 (file)
@@ -570,7 +570,7 @@ vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid()
   if ( !myLocalGrid && !GetMesh()->isCompacted() )
   {
     GetMesh()->compactMesh();
-        updateEntitiesFlags();
+    updateEntitiesFlags();
     vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
     myGrid->ShallowCopy(theGrid);
   }
index 076a102b1ab6d0e4e186ce6cc3651cd26b6b8ceb..87a2f15589acdfe42066b515bf39be6ad6ebca0c 100644 (file)
@@ -322,11 +322,11 @@ SMDS_BallElement* SMDS_Mesh::AddBallWithID(const SMDS_MeshNode * n, double diame
   SMDS_BallElement *ball = myBallPool->getNew();
   ball->init(n->getVtkId(), diameter, this);
   if (!this->registerElement(ID,ball))
-    {
-      this->myGrid->GetCellTypesArray()->SetValue(ball->getVtkId(), VTK_EMPTY_CELL);
-      myBallPool->destroy(ball);
-      return 0;
-    }
+  {
+    this->myGrid->GetCellTypesArray()->SetValue(ball->getVtkId(), VTK_EMPTY_CELL);
+    myBallPool->destroy(ball);
+    return 0;
+  }
   adjustmyCellsCapacity(ID);
   myCells[ID] = ball;
   myInfo.myNbBalls++;
index 05dd4e4ddc17b0017f73e8896a516d62f0763874..95438eab06489782eb060766051d2ef23861e0d2 100644 (file)
@@ -28,6 +28,8 @@
 #include "SMDS_Mesh0DElement.hxx"
 #include "SMDS_IteratorOfElements.hxx"
 #include "SMDS_MeshNode.hxx"
+#include "SMDS_Mesh.hxx"
+
 #include "utilities.h"
 
 using namespace std;
@@ -143,7 +145,19 @@ bool SMDS_Mesh0DElement::ChangeNodes(const SMDS_MeshNode* nodes[], const int nbN
 {
   if ( nbNodes == 1 )
   {
+    vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+    vtkIdType npts = 0;
+    vtkIdType* pts = 0;
+    grid->GetCellPoints(myVtkID, npts, pts);
+    if (nbNodes != npts)
+    {
+      MESSAGE("ChangeNodes problem: not the same number of nodes " << npts << " -> " << nbNodes);
+      return false;
+    }
     myNode = nodes[0];
+    pts[0] = myNode->getVtkId();
+
+    SMDS_Mesh::_meshList[myMeshId]->setMyModified();
     return true;
   }
   return false;
index 89e85dc2e7f3a3a02651f71155b8b78faf96e2ca..fc83430d08f181b6df11003eaafd3cf1b411fa0e 100644 (file)
@@ -7912,7 +7912,8 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes)
 
     if ( isOk ) // the non-poly elem remains valid after sticking nodes
     {
-      if ( nbNodes != nbUniqueNodes )
+      if ( nbNodes != nbUniqueNodes ||
+           !aMesh->ChangeElementNodes( elem, & curNodes[0], nbNodes ))
       {
         elemType.Init( elem ).SetID( elem->GetID() );
 
@@ -7926,10 +7927,6 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes)
         if ( elem != newElem )
           ReplaceElemInGroups( elem, newElem, aMesh );
       }
-      else
-      {
-        aMesh->ChangeElementNodes( elem, & curNodes[0], nbNodes );
-      }
     }
     else {
       // Remove invalid regular element or invalid polygon
index 76f50ada4af8fe02c24d93084e3cb862297ba097..51c6b65c59be0a51c95f7f5a315180413ccccb93 100755 (executable)
@@ -3363,7 +3363,7 @@ bool SMESHGUI_FilterDlg::onApply()
     insertFilterInViewer();
 
     if (!myFilter[ aCurrType ]->GetPredicate()->_is_nil()) {
-      // 
+      //
       bool toFilter = (( SMESH::FindActorByObject( myMesh )) ||
                        ( myInitSourceWgOnApply && mySourceWg ) ||
                        ( mySourceGrp->checkedId() == Dialog && mySourceWg ));
@@ -3372,6 +3372,9 @@ bool SMESHGUI_FilterDlg::onApply()
         filterSource(aCurrType, aResultIds);
         // select in viewer
         selectInViewer(aCurrType, aResultIds);
+        // set ids to the dialog
+        if ( myInitSourceWgOnApply || mySourceGrp->checkedId() == Dialog )
+          setIdsToWg(mySourceWg, aResultIds);
       }
     }
 
@@ -3675,10 +3678,6 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QList<int>& th
   // insert previously stored filter in viewer if necessary
   if (!aFilter.IsNull())
     SMESH::SetFilter(aFilter);
-
-  // set ids to the dialog
-  if (myInitSourceWgOnApply || mySourceGrp->checkedId() == Dialog)
-    setIdsToWg(mySourceWg, theIds);
 }
 
 //=======================================================================
index ec442214e9bf56d0dfade8f515c324e0b5a6f413..f594f650d623db168922ce2979574f6915b265db 100644 (file)
@@ -122,37 +122,35 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction)
   myIdPreview = new SMESHGUI_IdPreview(SMESH::GetViewWindow( mySMESHGUI ));
 
   SUIT_ResourceMgr* aResMgr = SMESH::GetResourceMgr( mySMESHGUI );
-  QPixmap IconMergeNodes (aResMgr->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES")));
-  QPixmap IconMergeElems (aResMgr->loadPixmap("SMESH", tr("ICON_DLG_MERGE_ELEMENTS")));
+  // QPixmap IconMergeNodes (aResMgr->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES")));
+  // QPixmap IconMergeElems (aResMgr->loadPixmap("SMESH", tr("ICON_DLG_MERGE_ELEMENTS")));
   QPixmap IconSelect     (aResMgr->loadPixmap("SMESH", tr("ICON_SELECT")));
   QPixmap IconAdd        (aResMgr->loadPixmap("SMESH", tr("ICON_APPEND")));
   QPixmap IconRemove     (aResMgr->loadPixmap("SMESH", tr("ICON_REMOVE")));
 
   setSizeGripEnabled(true);
 
-  QVBoxLayout* DlgLayout = new QVBoxLayout(this);
-  DlgLayout->setSpacing(SPACING);
-  DlgLayout->setMargin(MARGIN);
-
   /***************************************************************/
-  GroupConstructors = new QGroupBox(myAction == MERGE_ELEMENTS ? 
-                                    tr("SMESH_MERGE_ELEMENTS") : 
-                                    tr("SMESH_MERGE_NODES"), 
-                                    this);
-
-  QButtonGroup* ButtonGroup = new QButtonGroup(this);
-  QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
-  GroupConstructorsLayout->setSpacing(SPACING);
-  GroupConstructorsLayout->setMargin(MARGIN);
-
-  RadioButton = new QRadioButton(GroupConstructors);
-  RadioButton->setIcon(myAction == MERGE_ELEMENTS ? IconMergeElems : IconMergeNodes);
-  RadioButton->setChecked(true);
-  GroupConstructorsLayout->addWidget(RadioButton);
-  ButtonGroup->addButton(RadioButton, 0);
+  // Controls to switch dialog behaviour (myTypeId)
+
+  TypeBox   = new QGroupBox( tr("SMESH_MODE"), this );
+  GroupType = new QButtonGroup( this );
+  QHBoxLayout* aTypeBoxLayout = new QHBoxLayout( TypeBox );
+  aTypeBoxLayout->setMargin( MARGIN );
+  aTypeBoxLayout->setSpacing( SPACING );
+
+  QRadioButton* rb1 = new QRadioButton( tr( "SMESH_AUTOMATIC" ), TypeBox );
+  QRadioButton* rb2 = new QRadioButton( tr( "SMESH_MANUAL" ),   TypeBox );
+  GroupType->addButton( rb1, 0 );
+  GroupType->addButton( rb2, 1 );
+  aTypeBoxLayout->addWidget( rb1 );
+  aTypeBoxLayout->addWidget( rb2 );
+
+  myTypeId = TYPE_AUTO;
 
   /***************************************************************/
   // Controls for mesh defining
+
   GroupMesh = new QGroupBox(tr("SMESH_SELECT_WHOLE_MESH"), this);
   QHBoxLayout* GroupMeshLayout = new QHBoxLayout(GroupMesh);
   GroupMeshLayout->setSpacing(SPACING);
@@ -168,46 +166,44 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction)
   GroupMeshLayout->addWidget(SelectMeshButton);
   GroupMeshLayout->addWidget(LineEditMesh);
 
-  /***************************************************************/
-  // Controls for switch dialog behaviour (myTypeId)
-
-  TypeBox = new QGroupBox( tr( "SMESH_MODE" ), this );
-  GroupType = new QButtonGroup( this );
-  QHBoxLayout* aTypeBoxLayout = new QHBoxLayout( TypeBox );
-  aTypeBoxLayout->setMargin( MARGIN );
-  aTypeBoxLayout->setSpacing( SPACING );
-
-  QRadioButton* rb1 = new QRadioButton( tr( "SMESH_AUTOMATIC" ), TypeBox );
-  QRadioButton* rb2 = new QRadioButton( tr( "SMESH_MANUAL" ),   TypeBox );
-  GroupType->addButton( rb1, 0 );
-  GroupType->addButton( rb2, 1 );
-  aTypeBoxLayout->addWidget( rb1 );
-  aTypeBoxLayout->addWidget( rb2 );
-
-  myTypeId = TYPE_AUTO;
-
   /***************************************************************/
   // Controls for coincident elements detecting
-  GroupCoincident = new QGroupBox(myAction == MERGE_ELEMENTS ? 
-                                  tr("COINCIDENT_ELEMENTS") : 
-                                  tr("COINCIDENT_NODES"), 
+
+  GroupCoincident = new QGroupBox(myAction == MERGE_ELEMENTS ?
+                                  tr("COINCIDENT_ELEMENTS") :
+                                  tr("COINCIDENT_NODES"),
                                   this);
 
-  QVBoxLayout* aCoincidentLayout = new QVBoxLayout(GroupCoincident);
+  QGridLayout* aCoincidentLayout = new QGridLayout(GroupCoincident);
   aCoincidentLayout->setSpacing(SPACING);
   aCoincidentLayout->setMargin(MARGIN);
 
   if (myAction == MERGE_NODES) // case merge nodes
   {
-    QWidget* foo = new QWidget(GroupCoincident);
-    TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), foo);
-    SpinBoxTolerance = new SMESHGUI_SpinBox(foo);
+    /***************************************************************/
+    // Node specific Controls: tolerance, ...
+
+    NodeSpecWidget = new QWidget( this );
+
+    QLabel* TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), NodeSpecWidget);
+    SpinBoxTolerance = new SMESHGUI_SpinBox( NodeSpecWidget );
     SpinBoxTolerance->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
 
-    SeparateCornersAndMedium = new QCheckBox(tr("SEPARATE_CORNERS_AND_MEDIUM"), foo);
+    SeparateCornersAndMedium = new QCheckBox(tr("SEPARATE_CORNERS_AND_MEDIUM"), NodeSpecWidget );
     SeparateCornersAndMedium->setEnabled( false );
 
-    GroupExclude = new QGroupBox(tr("EXCLUDE_GROUPS"), foo);
+    QGridLayout* NodeSpecLayout = new QGridLayout(NodeSpecWidget);
+    NodeSpecLayout->setSpacing(SPACING);
+    NodeSpecLayout->setMargin(0);
+
+    NodeSpecLayout->addWidget(TextLabelTolerance,       0, 0 );
+    NodeSpecLayout->addWidget(SpinBoxTolerance,         0, 1 );
+    NodeSpecLayout->addWidget(SeparateCornersAndMedium, 1, 0, 1, 2 );
+
+    /***************************************************************/
+    // Exclude groups
+
+    GroupExclude = new QGroupBox(tr("EXCLUDE_GROUPS"), this );
     GroupExclude->setCheckable( true );
     GroupExclude->setChecked( false );
     ListExclude = new QListWidget( GroupExclude );
@@ -216,11 +212,14 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction)
     GroupExcludeLayout->setMargin(MARGIN);
     GroupExcludeLayout->addWidget(ListExclude);
 
-    QGroupBox*  GroupKeep = new QGroupBox(tr("KEEP_NODES"), foo);
+    /***************************************************************/
+    // Nodes to keep
+
+    GroupKeep = new QGroupBox(tr("KEEP_NODES"), this);
     SelectKeepNodesButton = new QPushButton( GroupKeep );
     SelectKeepNodesButton->setIcon( IconSelect );
     QLabel*       selectLabel = new QLabel(tr("SELECT"));
-    QRadioButton*   idsButton = new QRadioButton(tr("NODE_IDS"), GroupKeep);
+    QRadioButton*   idsButton = new QRadioButton(tr("SMESH_NODES"), GroupKeep);
     QRadioButton* groupButton = new QRadioButton(tr("GROUP_SUBMESH"), GroupKeep);
     KeepFromButGroup = new QButtonGroup( this );
     KeepFromButGroup->addButton( idsButton,   0 );
@@ -238,19 +237,10 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction)
     GroupKeepLayout->addWidget( selectLabel,           0, 1 );
     GroupKeepLayout->addWidget( idsButton,             0, 2 );
     GroupKeepLayout->addWidget( groupButton,           0, 3, 1, 2 );
-    GroupKeepLayout->addWidget( KeepList,              1, 0, 2, 4 );
+    GroupKeepLayout->addWidget( KeepList,              1, 0, 3, 4 );
     GroupKeepLayout->addWidget( AddKeepNodesButton,    1, 4, 1, 1 );
     GroupKeepLayout->addWidget( RemoveKeepNodesButton, 2, 4, 1, 1 );
-
-    QGridLayout* fooLayout = new QGridLayout( foo );
-    fooLayout->setSpacing(SPACING);
-    fooLayout->setMargin(0);
-    fooLayout->addWidget(TextLabelTolerance,       0, 0 );
-    fooLayout->addWidget(SpinBoxTolerance,         0, 1 );
-    fooLayout->addWidget(SeparateCornersAndMedium, 1, 0 );
-    fooLayout->addWidget(GroupExclude,             2, 0, 1, 2 );
-    fooLayout->addWidget(GroupKeep,                3, 0, 1, 2 );
-    aCoincidentLayout->addWidget(foo);
+    GroupKeepLayout->setRowStretch(3, 5);
 
     // Costruction of the logical filter
     QList<SUIT_SelectionFilter*> aListOfFilters;
@@ -260,7 +250,7 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction)
       new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR, /*takeOwnership=*/true);
   }
   else {
-    TextLabelTolerance     = 0;
+    NodeSpecWidget         = 0;
     SpinBoxTolerance       = 0;
     GroupExclude           = 0;
     ListExclude            = 0;
@@ -272,35 +262,31 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction)
     mySubMeshOrGroupFilter = 0;
   }
 
-  GroupCoincidentWidget = new QWidget(GroupCoincident);
-  QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincidentWidget);
-  GroupCoincidentLayout->setSpacing(SPACING);
-  GroupCoincidentLayout->setMargin(0);
-
-  ListCoincident = new QListWidget(GroupCoincidentWidget);
+  ListCoincident = new QListWidget(GroupCoincident);
   ListCoincident->setSelectionMode(QListWidget::ExtendedSelection);
 
-  DetectButton      = new QPushButton(tr("DETECT"),           GroupCoincidentWidget);
-  AddGroupButton    = new QPushButton(tr("SMESH_BUT_ADD"),    GroupCoincidentWidget);
-  RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincidentWidget);
+  DetectButton      = new QPushButton(tr("DETECT"),           GroupCoincident);
+  AddGroupButton    = new QPushButton(tr("SMESH_BUT_ADD"),    GroupCoincident);
+  RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincident);
 
-  SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincidentWidget);
-  ShowIDs = new QCheckBox(myAction == MERGE_ELEMENTS ? tr("SHOW_ELEMS_IDS") : tr("SHOW_NODES_IDS"), GroupCoincidentWidget);
+  SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincident);
+  ShowIDs = new QCheckBox(myAction == MERGE_ELEMENTS ? tr("SHOW_ELEMS_IDS") : tr("SHOW_NODES_IDS"), GroupCoincident);
 
-  GroupCoincidentLayout->addWidget(ListCoincident,    0,   0, 4, 2);
-  GroupCoincidentLayout->addWidget(DetectButton,      0,   2);
-  GroupCoincidentLayout->addWidget(AddGroupButton,    2, 2);
-  GroupCoincidentLayout->addWidget(RemoveGroupButton, 3, 2);
-  GroupCoincidentLayout->addWidget(SelectAllCB,       4, 0);
-  GroupCoincidentLayout->addWidget(ShowIDs,           4, 1);
-  GroupCoincidentLayout->setRowMinimumHeight(1, 10);
-  GroupCoincidentLayout->setRowStretch(1, 5);
-
-  aCoincidentLayout->addWidget(GroupCoincidentWidget);
+  aCoincidentLayout->addWidget(ListCoincident,    0, 0, 4, 2);
+  aCoincidentLayout->addWidget(DetectButton,      0, 2);
+  aCoincidentLayout->addWidget(AddGroupButton,    2, 2);
+  aCoincidentLayout->addWidget(RemoveGroupButton, 3, 2);
+  aCoincidentLayout->addWidget(SelectAllCB,       4, 0);
+  aCoincidentLayout->addWidget(ShowIDs,           4, 1);
+  aCoincidentLayout->setRowMinimumHeight(1, 10);
+  aCoincidentLayout->setRowStretch(1, 5);
 
   /***************************************************************/
   // Controls for editing the selected group
-  GroupEdit = new QGroupBox(tr("EDIT_SELECTED_GROUP"), this);
+
+  GroupEdit = new QGroupBox(myAction == MERGE_NODES ?
+                            tr("EDIT_SELECTED_NODE_GROUP") :
+                            tr("EDIT_SELECTED_ELEM_GROUP"), this);
   QGridLayout* GroupEditLayout = new QGridLayout(GroupEdit);
   GroupEditLayout->setSpacing(SPACING);
   GroupEditLayout->setMargin(MARGIN);
@@ -349,16 +335,49 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction)
   GroupButtonsLayout->addWidget(buttonHelp);
 
   /***************************************************************/
-  DlgLayout->addWidget(GroupConstructors);
-  DlgLayout->addWidget(GroupMesh);
-  DlgLayout->addWidget(TypeBox);
-  DlgLayout->addWidget(GroupCoincident);
-  DlgLayout->addWidget(GroupEdit);
-  DlgLayout->addWidget(GroupButtons);
-
-  GroupCoincidentWidget->setVisible( myAction != MERGE_NODES );
-  GroupCoincident      ->setVisible( myAction == MERGE_NODES );
-  //if GroupExclude->setVisible( myAction == MERGE_NODES );
+  if (myAction == MERGE_NODES)
+  {
+    QWidget* LeftWdg = new QWidget( this );
+    QVBoxLayout* LeftLayout = new QVBoxLayout(LeftWdg);
+    LeftLayout->setSpacing(SPACING);
+    LeftLayout->setMargin(0);
+    LeftLayout->addWidget(TypeBox);
+    LeftLayout->addWidget(GroupMesh);
+    LeftLayout->addWidget(NodeSpecWidget);
+    LeftLayout->addWidget(GroupCoincident);
+    LeftLayout->addStretch();
+    LeftLayout->addWidget(GroupButtons);
+    LeftLayout->setStretch( 3, 10 );
+
+    QWidget* RightWdg = new QWidget( this );
+    QVBoxLayout* RightLayout = new QVBoxLayout(RightWdg);
+    RightLayout->setSpacing(SPACING);
+    RightLayout->setMargin(0);
+    RightLayout->addWidget(GroupExclude);
+    RightLayout->addWidget(GroupKeep);
+    RightLayout->addWidget(GroupEdit);
+    RightLayout->setStretch( 0, 4 );
+    RightLayout->setStretch( 1, 5 );
+
+    QHBoxLayout* DlgLayout = new QHBoxLayout(this);
+    DlgLayout->setSpacing(SPACING*2);
+    DlgLayout->setMargin(MARGIN);
+    DlgLayout->addWidget( LeftWdg );
+    DlgLayout->addWidget( RightWdg );
+  }
+  else
+  {
+    QVBoxLayout* DlgLayout = new QVBoxLayout(this);
+    DlgLayout->setSpacing(SPACING);
+    DlgLayout->setMargin(MARGIN);
+    DlgLayout->addWidget(TypeBox);
+    DlgLayout->addWidget(GroupMesh);
+    DlgLayout->addWidget(GroupCoincident);
+    DlgLayout->addWidget(GroupEdit);
+    DlgLayout->addWidget(GroupButtons);
+  }
+
+  GroupCoincident->hide();
   GroupEdit->hide();
 
   this->resize(10,10);
@@ -388,8 +407,6 @@ void SMESHGUI_MergeDlg::Init()
     SpinBoxTolerance->SetValue(1e-05);
   }
 
-  RadioButton->setChecked(true);
-
   GroupType->button(0)->setChecked(true);
 
   myEditCurrentArgument = (QWidget*)LineEditMesh;
@@ -581,7 +598,8 @@ bool SMESHGUI_MergeDlg::ClickOnApply()
         SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INFORMATION"),
                                      tr("SMESH_MERGED_ELEMENTS").arg(QString::number(ListCoincident->count()).toLatin1().data()));
     }
-    nodesToKeep->length(0); // release before tmpIdSource calls UnRegister()
+    if ( & nodesToKeep.in() )
+      nodesToKeep->length(0); // release before tmpIdSource calls UnRegister()
 
   }
   catch(...) {
@@ -808,6 +826,17 @@ void SMESHGUI_MergeDlg::onSelectGroup()
   if( ListCoincident->count() != ListCoincident->selectedItems().count() )
     SelectAllCB->setChecked( false );
 
+  if ( myEditCurrentArgument == (QWidget*)KeepList && KeepList &&
+       !isKeepNodesIDsSelection() )
+  {
+    // restore selection of nodes after selection of sub-meshes
+    mySelectionMgr->clearFilters();
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode( NodeSelection );
+    SMESH::SetPointRepresentation( true );
+    myEditCurrentArgument = ListCoincident;
+  }
+
   myEditCurrentArgument = (QWidget*)ListCoincident;
 
   myIsBusy = true;
@@ -904,6 +933,17 @@ void SMESHGUI_MergeDlg::onSelectElementFromGroup()
     }
   else 
     myIdPreview->SetPointsLabeled(false);
+
+  if ( myEditCurrentArgument == (QWidget*)KeepList && KeepList &&
+       !isKeepNodesIDsSelection() )
+  {
+    // restore selection of nodes after selection of sub-meshes
+    mySelectionMgr->clearFilters();
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode( NodeSelection );
+    SMESH::SetPointRepresentation( true );
+    myEditCurrentArgument = ListCoincident;
+  }
 }
 
 //=================================================================================
@@ -1082,6 +1122,7 @@ void SMESHGUI_MergeDlg::SetEditCurrentArgument()
     }
     else
     {
+      SMESH::SetPointRepresentation( false );
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
         aViewWindow->SetSelectionMode( ActorSelection );
       mySelectionMgr->installFilter( mySubMeshOrGroupFilter );
@@ -1163,6 +1204,7 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument()
       myGroups.clear();
       ListExclude->clear();
       SMESH::ListOfGroups_var aListOfGroups = myMesh->GetGroups();
+      GroupExclude->setEnabled( aListOfGroups->length() > 0 );
       for( int i = 0, n = aListOfGroups->length(); i < n; i++ ) {
         SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i];
         if ( !aGroup->_is_nil() ) { // && aGroup->GetType() == SMESH::NODE
@@ -1241,13 +1283,17 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument()
 //=================================================================================
 void SMESHGUI_MergeDlg::DeactivateActiveDialog()
 {
-  if (GroupConstructors->isEnabled()) {
-    GroupConstructors->setEnabled(false);
+  if (TypeBox->isEnabled()) {
     TypeBox->setEnabled(false);
     GroupMesh->setEnabled(false);
     GroupCoincident->setEnabled(false);
     GroupEdit->setEnabled(false);
     GroupButtons->setEnabled(false);
+    if (myAction == MERGE_NODES)
+    {
+      GroupExclude->setEnabled(false);
+      GroupKeep->setEnabled(false);
+    }
     mySMESHGUI->ResetState();
     mySMESHGUI->SetActiveDialogBox(0);
   }
@@ -1264,12 +1310,16 @@ void SMESHGUI_MergeDlg::ActivateThisDialog()
 {
   /* Emit a signal to deactivate the active dialog */
   mySMESHGUI->EmitSignalDeactivateDialog();
-  GroupConstructors->setEnabled(true);
   TypeBox->setEnabled(true);
   GroupMesh->setEnabled(true);
   GroupCoincident->setEnabled(true);
   GroupEdit->setEnabled(true);
   GroupButtons->setEnabled(true);
+  if (myAction == MERGE_NODES)
+  {
+    GroupExclude->setEnabled(false);
+    GroupKeep->setEnabled(false);
+  }
 
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
@@ -1282,7 +1332,7 @@ void SMESHGUI_MergeDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_MergeDlg::enterEvent (QEvent*)
 {
-  if ( !GroupConstructors->isEnabled() ) {
+  if ( !TypeBox->isEnabled() ) {
     SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
     if ( aViewWindow && !mySelector) {
       mySelector = aViewWindow->GetSelector();
@@ -1326,11 +1376,11 @@ void SMESHGUI_MergeDlg::onTypeChanged (int id)
     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
       aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->clearFilters();
-    if (myAction == MERGE_NODES)
-      GroupCoincidentWidget->hide();
-    else
-      GroupCoincident->hide();
+    GroupCoincident->hide();
     GroupEdit->hide();
+
+    GroupMesh->hide(); // <--- a trick to make the dialog take a minimal size
+    GroupMesh->show();
     break;
 
   case TYPE_MANUAL: // manual
@@ -1346,31 +1396,30 @@ void SMESHGUI_MergeDlg::onTypeChanged (int id)
     if (aSmeshGroupFilter)    aListOfFilters.append(aSmeshGroupFilter);
     
     myMeshOrSubMeshOrGroupFilter =
-      new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
+      new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR, true);
 
     if (myAction == MERGE_NODES) {
-      GroupCoincidentWidget->show();
       SMESH::SetPointRepresentation(true);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
         if( mySelector->IsSelectionEnabled() )
           aViewWindow->SetSelectionMode(NodeSelection);
     }
     else {
-      GroupCoincident->show();
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
         if( mySelector->IsSelectionEnabled() )
           aViewWindow->SetSelectionMode(CellSelection);
     }
+    GroupCoincident->show();
     GroupEdit->show();
     break;
   }
+  SelectionIntoArgument();
+
   updateControls();
 
   qApp->processEvents();
   updateGeometry();
   resize(10,10);
-
-  SelectionIntoArgument();
 }
 
 //=======================================================================
index 52fd3d556d26e97f9dbf4c76ebd5c0ed3b2bcd83..86595b82a1295d217d3c22220855feaff6966215 100644 (file)
@@ -115,8 +115,6 @@ private:
   int                       myTypeId; // manual(1) or automatic(0)
 
   // Widgets
-  QGroupBox*                GroupConstructors;
-  QRadioButton*             RadioButton;
 
   QGroupBox*                GroupButtons;
   QPushButton*              buttonOk;
@@ -129,11 +127,12 @@ private:
   QPushButton*              SelectMeshButton;
   QLineEdit*                LineEditMesh;
 
-  QGroupBox*                GroupCoincident;
-  QWidget*                  GroupCoincidentWidget;
-  QLabel*                   TextLabelTolerance;
+  QWidget*                  NodeSpecWidget;
   SMESHGUI_SpinBox*         SpinBoxTolerance;
   QCheckBox*                SeparateCornersAndMedium;
+
+  QGroupBox*                GroupCoincident;
+  //QWidget*                  GroupCoincidentWidget;
   QPushButton*              DetectButton;
   QListWidget*              ListCoincident;
   QPushButton*              AddGroupButton;
@@ -150,6 +149,7 @@ private:
   QGroupBox*                GroupExclude;
   QListWidget*              ListExclude;
 
+  QGroupBox*                GroupKeep;
   QButtonGroup*             KeepFromButGroup;
   QPushButton*              SelectKeepNodesButton;
   QPushButton*              AddKeepNodesButton;
index b85c1586dfa0ee52f221540af894e337c1567674..2868c1ed60a815c258d55e157f0d8ec205be6e7b 100644 (file)
@@ -527,9 +527,11 @@ void SMESHGUI_RemoveElementsDlg::setFilters()
     myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
 
   QList<int> types;
-  if ( myMesh->NbEdges()   ) types << SMESH::EDGE;
-  if ( myMesh->NbFaces()   ) types << SMESH::FACE;
-  if ( myMesh->NbVolumes() ) types << SMESH::VOLUME;
+  if ( myMesh->NbEdges()     ) types << SMESH::EDGE;
+  if ( myMesh->NbFaces()     ) types << SMESH::FACE;
+  if ( myMesh->NbVolumes()   ) types << SMESH::VOLUME;
+  if ( myMesh->NbBalls()     ) types << SMESH::BALL;
+  if ( myMesh->Nb0DElements()) types << SMESH::ELEM0D;
 
   myFilterDlg->Init( types );
   myFilterDlg->SetSelection();
index d0a5cc5db624c1a3d137c782db318aae86175981..00ce12ef3044de3849791cec619aaa2049334d75 100644 (file)
@@ -44,6 +44,7 @@
 // SALOME GUI includes
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
+#include <SALOMEDSClient_Study.hxx>
 #include <SALOME_ListIO.hxx>
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
@@ -282,7 +283,7 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule )
   AutoSewCheck->setChecked( true );
 
   // mesh
-  QGroupBox* GroupMesh = new QGroupBox(tr("SMESH_SELECT_WHOLE_MESH"), SewFreeBordersWidget);
+  QGroupBox* GroupMesh = new QGroupBox(tr("SMESH_MESH"), SewFreeBordersWidget);
   QHBoxLayout* GroupMeshLayout = new QHBoxLayout(GroupMesh);
   GroupMeshLayout->setSpacing(SPACING);
   GroupMeshLayout->setMargin(MARGIN);
@@ -453,8 +454,9 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule )
   myHelpFileName = "sewing_meshes_page.html";
 
   myActor = 0;
-  setDisplayMode();
+  myStoredEntityMode = 0;
 
+  setDisplayMode();
   Init();
 
   /* signals and slots connections */
@@ -572,6 +574,8 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
       CheckBoxPolyedrs->hide();
   }
 
+  CheckBoxMerge->setVisible ( constructorId == 3 );
+
   if (( !SubGroup1->isVisible() ) &&
       ( constructorId != 0 || ModeButGrp->checkedId() == MODE_MANUAL ))
   {
@@ -702,6 +706,8 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
 
 void SMESHGUI_SewingDlg::setDisplayMode()
 {
+  if ( myStoredEntityMode )
+    return;
   myStoredEntityMode = 0;
   myStoredRepresentation = -1;
 
@@ -1640,7 +1646,8 @@ void SMESHGUI_SewingDlg::SelectionIntoArgument (bool isSelectionChanged)
 
   if ( myEditCurrentArgument == LineEditMesh )
   {
-    LineEditMesh->setText( IO->getName() );
+    if ( _PTR(SObject) meshSO = SMESH::FindSObject( myMesh ))
+      LineEditMesh->setText( meshSO->GetName().c_str() );
     ListCoincident->clear();
     if ( AutoSewCheck->isChecked() )
     {
index 36a4916ccafdf0126575b66b0a97d569571d69d3..35fce6308ebfb87124dacacda2ece86f7fe9828c 100644 (file)
@@ -5120,8 +5120,12 @@ Please select a group and try again</translation>
         <translation>Detect</translation>
     </message>
     <message>
-        <source>EDIT_SELECTED_GROUP</source>
-        <translation>Edit selected group</translation>
+        <source>EDIT_SELECTED_NODE_GROUP</source>
+        <translation>Edit selected group of coincident nodes</translation>
+    </message>
+    <message>
+        <source>EDIT_SELECTED_ELEM_GROUP</source>
+        <translation>Edit selected group of coincident elements</translation>
     </message>
     <message>
         <source>SELECT_ALL</source>
@@ -5137,7 +5141,7 @@ Please select a group and try again</translation>
     </message>
     <message>
         <source>EXCLUDE_GROUPS</source>
-        <translation>Exclude Groups</translation>
+        <translation>Exclude groups from detection</translation>
     </message>
     <message>
         <source>SEPARATE_CORNERS_AND_MEDIUM</source>
@@ -5145,11 +5149,11 @@ Please select a group and try again</translation>
     </message>
     <message>
         <source>KEEP_NODES</source>
-        <translation>Nodes to keep</translation>
+        <translation>Nodes to keep during the merge</translation>
     </message>
     <message>
         <source>GROUP_SUBMESH</source>
-        <translation>Groups and Sub-meshes</translation>
+        <translation>Groups and sub-meshes</translation>
     </message>
     <message>
         <source>SELECT</source>
index 66ac2ff309a0487e65c931b1aa78ff2fe2299294..49a36cd9cad43adfe90852123f6cbb588adb7058 100644 (file)
@@ -47,7 +47,7 @@
 #include <TopoDS_Wire.hxx>
 
 #ifdef _DEBUG_
-//#define _MYDEBUG_
+#define _MYDEBUG_
 #include "SMESH_File.hxx"
 #include "SMESH_Comment.hxx"
 #endif
@@ -381,10 +381,10 @@ namespace
     for ( size_t i = 0; i < bndSegs.size(); ++i )
     {
       if ( !bndSegs[i]._edge )
-        text << "# " << i << " NULL edge";
+        text << "# " << i << " NULL edge\n";
       else if ( !bndSegs[i]._edge->vertex0() ||
                 !bndSegs[i]._edge->vertex1() )
-        text << "# " << i << " INFINITE edge";
+        text << "# " << i << " INFINITE edge\n";
       else if ( addedEdges.insert( bndSegs[i]._edge ).second &&
                 addedEdges.insert( bndSegs[i]._edge->twin() ).second )
       {
@@ -407,7 +407,7 @@ namespace
     }
     text << "\n";
     file.write( text.c_str(), text.size() );
-    cout << "Write " << fileName << endl;
+    cout << "execfile( '" << fileName << "')" << endl;
 #endif
   }
 
index 362a61835b8e67736f0c2802afb505395461a5e2..76c2f35d64af727c971b07e3eb76a08226fced5d 100644 (file)
@@ -771,9 +771,14 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
       }
       else if ( SMESH::DownCast< SMESH_Group_i* > ( theGroup ))
       {
-        SMESH::array_of_ElementType_var allElemTypes = theMesh->GetTypes();
-        for ( size_t i =0; i < allElemTypes->length() && isEmpty; ++i )
-          isEmpty = ( allElemTypes[i] != theGroup->GetType() );
+        if ( theGroup->GetType() == SMESH::NODE )
+          isEmpty = ( theMesh->NbNodes() == 0 );
+        else
+        {
+          SMESH::array_of_ElementType_var allElemTypes = theMesh->GetTypes();
+          for ( size_t i =0; i < allElemTypes->length() && isEmpty; ++i )
+            isEmpty = ( allElemTypes[i] != theGroup->GetType() );
+        }
       }
       aGroupSO = publish (theStudy, theGroup, aRootSO, 0, pm[isEmpty].c_str() );
     }