1 // SMESH SMESHGUI : GUI for SMESH component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESHGUI_MergeNodesDlg.cxx
25 // Author : Michael ZORIN
29 #include "SMESHGUI_MergeNodesDlg.h"
32 #include "SMESHGUI_Utils.h"
33 #include "SMESHGUI_VTKUtils.h"
34 #include "SMESHGUI_IdValidator.h"
35 #include "SMESHGUI_SpinBox.h"
37 #include "SMESH_Actor.h"
38 #include "SMESH_TypeFilter.hxx"
39 #include "SMDS_Mesh.hxx"
43 #include "SUIT_ResourceMgr.h"
45 #include "SVTK_ViewModel.h"
46 #include "SVTK_ViewWindow.h"
47 #include "SVTK_Selector.h"
48 #include "SVTK_Selection.h"
49 #include "SALOME_ListIO.hxx"
51 #include "utilities.h"
54 #include <TColStd_MapOfInteger.hxx>
57 #include <qapplication.h>
58 #include <qbuttongroup.h>
59 #include <qgroupbox.h>
61 #include <qlineedit.h>
63 #include <qlistview.h>
64 #include <qpushbutton.h>
65 #include <qradiobutton.h>
66 #include <qcheckbox.h>
73 //=================================================================================
74 // class : SMESHGUI_MergeNodesDlg()
76 //=================================================================================
77 SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char* name,
78 bool modal, WFlags fl)
79 : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
80 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
81 mySMESHGUI( theModule ),
82 mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
84 QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES")));
85 QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
88 setName("SMESHGUI_MergeNodesDlg");
90 setCaption(tr("SMESH_MERGE_NODES"));
91 setSizeGripEnabled(TRUE);
92 SMESHGUI_MergeNodesDlgLayout = new QGridLayout(this);
93 SMESHGUI_MergeNodesDlgLayout->setSpacing(6);
94 SMESHGUI_MergeNodesDlgLayout->setMargin(11);
96 /***************************************************************/
97 GroupConstructors = new QButtonGroup(this, "GroupConstructors");
98 GroupConstructors->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5,
99 (QSizePolicy::SizeType)0, 0, 0,
100 GroupConstructors->sizePolicy().hasHeightForWidth()));
101 GroupConstructors->setTitle(tr("SMESH_MERGE_NODES" ));
102 GroupConstructors->setExclusive(TRUE);
103 GroupConstructors->setColumnLayout(0, Qt::Vertical);
104 GroupConstructors->layout()->setSpacing(0);
105 GroupConstructors->layout()->setMargin(0);
106 GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
107 GroupConstructorsLayout->setAlignment(Qt::AlignTop);
108 GroupConstructorsLayout->setSpacing(6);
109 GroupConstructorsLayout->setMargin(11);
110 QHBoxLayout* RBLayout = new QHBoxLayout(0, 0, 6, "Layout2");
111 RadioButton1= new QRadioButton(GroupConstructors, "RadioButton1");
112 RadioButton1->setText(tr("" ));
113 RadioButton1->setPixmap(image0);
114 RBLayout->addWidget(RadioButton1);
115 GroupConstructorsLayout->addLayout(RBLayout, 0, 0);
116 SMESHGUI_MergeNodesDlgLayout->addWidget(GroupConstructors, 0, 0);
118 /***************************************************************/
119 GroupButtons = new QGroupBox(this, "GroupButtons");
120 GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7,
121 (QSizePolicy::SizeType)0, 0, 0,
122 GroupButtons->sizePolicy().hasHeightForWidth()));
123 GroupButtons->setGeometry(QRect(10, 10, 281, 48));
124 GroupButtons->setTitle(tr("" ));
125 GroupButtons->setColumnLayout(0, Qt::Vertical);
126 GroupButtons->layout()->setSpacing(0);
127 GroupButtons->layout()->setMargin(0);
128 GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
129 GroupButtonsLayout->setAlignment(Qt::AlignTop);
130 GroupButtonsLayout->setSpacing(6);
131 GroupButtonsLayout->setMargin(11);
132 buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
133 buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
134 buttonCancel->setAutoDefault(TRUE);
135 GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
136 buttonApply = new QPushButton(GroupButtons, "buttonApply");
137 buttonApply->setText(tr("SMESH_BUT_APPLY" ));
138 buttonApply->setAutoDefault(TRUE);
139 GroupButtonsLayout->addWidget(buttonApply, 0, 1);
140 QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
141 GroupButtonsLayout->addItem(spacer_9, 0, 2);
142 buttonOk = new QPushButton(GroupButtons, "buttonOk");
143 buttonOk->setText(tr("SMESH_BUT_OK" ));
144 buttonOk->setAutoDefault(TRUE);
145 buttonOk->setDefault(TRUE);
146 GroupButtonsLayout->addWidget(buttonOk, 0, 0);
147 SMESHGUI_MergeNodesDlgLayout->addWidget(GroupButtons, 4, 0);
149 /***************************************************************/
151 // Controls for mesh defining
152 GroupMesh = new QGroupBox(this, "GroupMesh");
153 GroupMesh->setTitle(tr("SMESH_MESH"));
154 GroupMesh->setColumnLayout(0, Qt::Vertical);
155 GroupMesh->layout()->setSpacing(0);
156 GroupMesh->layout()->setMargin(0);
157 GroupMeshLayout = new QGridLayout(GroupMesh->layout());
158 GroupMeshLayout->setAlignment(Qt::AlignTop);
159 GroupMeshLayout->setSpacing(6);
160 GroupMeshLayout->setMargin(11);
162 TextLabelName = new QLabel(GroupMesh, "TextLabelName");
163 TextLabelName->setText(tr("SMESH_NAME"));
164 GroupMeshLayout->addWidget(TextLabelName, 0, 0);
166 SelectMeshButton = new QPushButton(GroupMesh, "SelectMeshButton");
167 SelectMeshButton->setPixmap(image1);
168 GroupMeshLayout->addWidget(SelectMeshButton, 0, 1);
170 LineEditMesh = new QLineEdit(GroupMesh, "LineEditMesh");
171 LineEditMesh->setReadOnly(true);
172 GroupMeshLayout->addWidget(LineEditMesh, 0, 2);
174 SMESHGUI_MergeNodesDlgLayout->addWidget(GroupMesh, 1, 0);
176 // Controls for coincident nodes detecting
177 GroupCoincident = new QGroupBox(this, "GroupCoincident");
178 GroupCoincident->setTitle(tr("COINCIDENT_NODES"));
179 GroupCoincident->setColumnLayout(0, Qt::Vertical);
180 GroupCoincident->layout()->setSpacing(0);
181 GroupCoincident->layout()->setMargin(0);
182 QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident->layout());
183 GroupCoincidentLayout->setAlignment(Qt::AlignTop);
184 GroupCoincidentLayout->setSpacing(6);
185 GroupCoincidentLayout->setMargin(11);
187 TextLabelTolerance = new QLabel(GroupCoincident, "TextLabelTolerance");
188 TextLabelTolerance->setText(tr("SMESH_TOLERANCE"));
189 GroupCoincidentLayout->addWidget(TextLabelTolerance, 0, 0);
191 SpinBoxTolerance = new SMESHGUI_SpinBox(GroupCoincident, "SpinBoxTolerance");
192 GroupCoincidentLayout->addWidget(SpinBoxTolerance, 0, 1);
194 QPushButton* DetectButton = new QPushButton(GroupCoincident, "DetectButton");
195 DetectButton->setText(tr("DETECT"));
196 GroupCoincidentLayout->addWidget(DetectButton, 0, 2);
198 ListCoincident = new QListView(GroupCoincident);
199 ListCoincident->setSorting(-1);
200 ListCoincident->addColumn("Nodes");
201 ListCoincident->header()->hide();
203 GroupCoincidentLayout->addMultiCellWidget(ListCoincident, 1, 1, 0, 1);
205 SelectAllCB = new QCheckBox(GroupCoincident, "SelectAllCB");
206 SelectAllCB->setText(tr("SELECT_ALL"));
207 GroupCoincidentLayout->addWidget(SelectAllCB, 2, 0);
209 SMESHGUI_MergeNodesDlgLayout->addWidget(GroupCoincident, 2, 0);
211 // Controls for editing group of nodes
212 GroupEdit = new QGroupBox(this, "GroupEdit");
213 GroupEdit->setTitle(tr("EDIT_GROUP_OF_NODES"));
214 GroupEdit->setColumnLayout(0, Qt::Vertical);
215 GroupEdit->layout()->setSpacing(0);
216 GroupEdit->layout()->setMargin(0);
217 QGridLayout* GroupEditLayout = new QGridLayout(GroupEdit->layout());
218 GroupEditLayout->setAlignment(Qt::AlignTop);
219 GroupEditLayout->setSpacing(6);
220 GroupEditLayout->setMargin(11);
222 ListEdit = new QListBox(GroupEdit, "ListEdit");
223 ListEdit->setColumnMode(QListBox::FitToHeight);
224 ListEdit->setSelectionMode(QListBox::Extended);
225 GroupEditLayout->addMultiCellWidget(ListEdit, 0, 2, 0, 0);
227 QPushButton* AddButton = new QPushButton(GroupEdit, "AddButton");
228 AddButton->setText(tr("SMESH_BUT_ADD"));
229 GroupEditLayout->addWidget(AddButton, 0, 1);
231 QPushButton* RemoveButton = new QPushButton(GroupEdit, "RemoveButton");
232 RemoveButton->setText(tr("SMESH_BUT_REMOVE"));
233 GroupEditLayout->addWidget(RemoveButton, 1, 1);
235 QSpacerItem* spacer = new QSpacerItem(20, 200, QSizePolicy::Minimum, QSizePolicy::Expanding);
236 GroupEditLayout->addItem(spacer, 2, 1);
238 SMESHGUI_MergeNodesDlgLayout->addWidget(GroupEdit, 3, 0);
240 /* Initialisations */
241 SpinBoxTolerance->RangeStepAndValidator(0.0, 999999.999, 0.1, 3);
242 SpinBoxTolerance->SetValue(1e-05);
244 RadioButton1->setChecked(TRUE);
246 myEditCurrentArgument = (QWidget*)LineEditMesh;
250 mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
252 mySMESHGUI->SetActiveDialogBox((QDialog*)this);
254 myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
256 /* signals and slots connections */
257 connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
258 connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
259 connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
261 connect(SelectMeshButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
262 connect(DetectButton, SIGNAL (clicked()), this, SLOT(onDetect()));
263 connect(ListCoincident, SIGNAL (selectionChanged()), this, SLOT(onSelectNodesGroup()));
264 connect(ListCoincident, SIGNAL (pressed(QListViewItem*)), this, SLOT(updateControls()));
265 connect(ListCoincident, SIGNAL (currentChanged(QListViewItem*)), this, SLOT(updateControls()));
266 connect(SelectAllCB, SIGNAL(toggled(bool)), this, SLOT(onSelectAll(bool)));
267 connect(ListEdit, SIGNAL (selectionChanged()), this, SLOT(onSelectNodesFromGroup()));
268 connect(AddButton, SIGNAL (clicked()), this, SLOT(onAdd()));
269 connect(RemoveButton, SIGNAL (clicked()), this, SLOT(onRemove()));
271 connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
272 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
273 /* to close dialog if study change */
274 connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
276 this->show(); /* displays Dialog */
279 buttonOk->setEnabled(false);
280 buttonApply->setEnabled(false);
282 // Init Mesh field from selection
283 SelectionIntoArgument();
286 //=================================================================================
287 // function : ~SMESHGUI_MergeNodesDlg()
288 // purpose : Destroys the object and frees any allocated resources
289 //=================================================================================
290 SMESHGUI_MergeNodesDlg::~SMESHGUI_MergeNodesDlg()
292 // no need to delete child widgets, Qt does it all for us
295 //=================================================================================
296 // function : ClickOnApply()
298 //=================================================================================
299 bool SMESHGUI_MergeNodesDlg::ClickOnApply()
301 if (mySMESHGUI->isActiveStudyLocked() || myMesh->_is_nil())
305 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
307 QApplication::setOverrideCursor(Qt::waitCursor);
308 SMESH::array_of_long_array_var aGroupsOfNodes = new SMESH::array_of_long_array;
309 aGroupsOfNodes->length(ListCoincident->childCount());
310 QListViewItem* item = ListCoincident->firstChild();
314 QStringList aListIds = QStringList("");
315 if (((QCheckListItem*) item)->isOn())
316 aListIds = QStringList::split(" ", item->text(0), false);
318 SMESH::long_array_var anIds = new SMESH::long_array;
319 anIds->length(aListIds.count());
321 for (int i = 0; i < aListIds.count(); i++)
322 anIds[i] = aListIds[i].toInt();
324 aGroupsOfNodes[anArrayNum++] = anIds.inout();
326 item = item->itemBelow();
329 aMeshEditor->MergeNodes (aGroupsOfNodes.inout());
330 QApplication::restoreOverrideCursor();
334 //mySelectionMgr->clearSelected();
341 //=================================================================================
342 // function : ClickOnOk()
344 //=================================================================================
345 void SMESHGUI_MergeNodesDlg::ClickOnOk()
351 //=================================================================================
352 // function : ClickOnCancel()
354 //=================================================================================
355 void SMESHGUI_MergeNodesDlg::ClickOnCancel()
357 mySelectionMgr->clearFilters();
358 //mySelectionMgr->clearSelected();
359 SMESH::SetPointRepresentation(false);
360 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
361 aViewWindow->SetSelectionMode(ActorSelection);
362 disconnect(mySelectionMgr, 0, this, 0);
363 mySMESHGUI->ResetState();
367 //=================================================================================
368 // function : onEditNodesGroup()
370 //=================================================================================
371 void SMESHGUI_MergeNodesDlg::onEditNodesGroup()
373 if (ListCoincident->childCount() < 1)
376 QString aNewIds = "";
378 QListBoxItem* anItem;
379 for (anItem = ListEdit->firstItem(); anItem != 0; anItem = anItem->next())
380 aNewIds+=QString(" %1").arg(anItem->text());
382 ListCoincident->currentItem()->setText(0, aNewIds);
385 //=================================================================================
386 // function : updateControls()
388 //=================================================================================
389 void SMESHGUI_MergeNodesDlg::updateControls()
391 if (ListCoincident->childCount() < 1) {
392 SMESH::SetPointRepresentation(false);
393 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
394 aViewWindow->SetSelectionMode(ActorSelection);
398 bool hasChecked = false, hasUnchecked = false;
400 QListViewItem* item = ListCoincident->firstChild();
402 while (item && (!hasChecked || !hasUnchecked)) {
403 if (((QCheckListItem*) item)->isOn())
408 item = item->itemBelow();
412 SelectAllCB->setChecked(false);
414 bool enable = !(myMesh->_is_nil()) && hasChecked;
416 buttonOk->setEnabled(enable);
417 buttonApply->setEnabled(enable);
420 //=================================================================================
421 // function : onDetect()
423 //=================================================================================
424 void SMESHGUI_MergeNodesDlg::onDetect()
426 if (myMesh->_is_nil())
430 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
432 QApplication::setOverrideCursor(Qt::waitCursor);
433 ListCoincident->clear();
436 SMESH::array_of_long_array_var aNodeGroups;
437 aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aNodeGroups);
439 for (int i = 0; i < aNodeGroups->length(); i++) {
440 SMESH::long_array& aGroup = aNodeGroups[i];
443 for (int j = 0; j < aGroup.length(); j++)
444 aNodeIds+=QString(" %1").arg(aGroup[j]);
446 new QCheckListItem (ListCoincident, aNodeIds, QCheckListItem::CheckBox);
448 QApplication::restoreOverrideCursor();
455 //=================================================================================
456 // function : onSelectNodesGroup()
458 //=================================================================================
459 void SMESHGUI_MergeNodesDlg::onSelectNodesGroup()
464 myEditCurrentArgument = (QWidget*)ListCoincident;
466 QListViewItem* aSelectedItem = ListCoincident->selectedItem();
470 QStringList aListId = QStringList::split(" ", aSelectedItem->text(0), false);
473 ListEdit->insertStringList(aListId);
475 //mySelectionMgr->clearSelected();
476 //mySelectionMgr->AddIObject(myActor->getIO());
478 aList.Append(myActor->getIO());
479 mySelectionMgr->setSelectedObjects(aList, false);
481 SMESH::SetPointRepresentation(true);
482 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
483 aViewWindow->SetSelectionMode(NodeSelection);
485 ListEdit->selectAll(true);
488 //=================================================================================
489 // function : onSelectAll()
491 //=================================================================================
492 void SMESHGUI_MergeNodesDlg::onSelectAll (bool isToggled)
496 QListViewItem* item = ListCoincident->firstChild();
499 if (!((QCheckListItem*) item)->isOn())
500 ((QCheckListItem*) item)->setOn(true);
501 item = item->itemBelow();
505 buttonOk->setEnabled(true);
506 buttonApply->setEnabled(true);
511 //=================================================================================
512 // function : onSelectNodesFromGroup()
514 //=================================================================================
515 void SMESHGUI_MergeNodesDlg::onSelectNodesFromGroup()
520 TColStd_MapOfInteger aIndexes;
521 QListBoxItem* anItem;
522 for (anItem = ListEdit->firstItem(); anItem != 0; anItem = anItem->next()) {
523 if (anItem->isSelected()) {
524 int anId = anItem->text().toInt();
529 mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
531 aList.Append(myActor->getIO());
532 mySelectionMgr->setSelectedObjects(aList);
535 //=================================================================================
536 // function : onAdd()
538 //=================================================================================
539 void SMESHGUI_MergeNodesDlg::onAdd()
544 QString aListStr = "";
547 aNbNnodes = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
551 QStringList aNodes = QStringList::split(" ", aListStr);
552 QListBoxItem* anItem = 0;
554 for (QStringList::iterator it = aNodes.begin(); it != aNodes.end(); ++it) {
555 anItem = ListEdit->findItem(*it, Qt::ExactMatch);
557 anItem = new QListBoxText(*it);
558 ListEdit->insertItem(anItem);
560 ListEdit->setSelected(anItem, true);
566 //=================================================================================
567 // function : onRemove()
569 //=================================================================================
570 void SMESHGUI_MergeNodesDlg::onRemove()
572 if (myEditCurrentArgument != (QWidget*)ListCoincident)
575 for (int i = ListEdit->count(); i > 0; i--) {
576 if (ListEdit->isSelected(i-1))
577 ListEdit->removeItem(i-1);
582 //=================================================================================
583 // function : SetEditCurrentArgument()
585 //=================================================================================
586 void SMESHGUI_MergeNodesDlg::SetEditCurrentArgument()
588 QPushButton* send = (QPushButton*)sender();
590 disconnect(mySelectionMgr, 0, this, 0);
591 mySelectionMgr->clearSelected();
592 mySelectionMgr->clearFilters();
594 if (send == SelectMeshButton) {
595 myEditCurrentArgument = (QWidget*)LineEditMesh;
596 SMESH::SetPointRepresentation(false);
597 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
598 aViewWindow->SetSelectionMode(ActorSelection);
599 mySelectionMgr->installFilter(myMeshOrSubMeshFilter);
602 myEditCurrentArgument->setFocus();
603 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
604 SelectionIntoArgument();
607 //=================================================================================
608 // function : SelectionIntoArgument()
609 // purpose : Called when selection as changed or other case
610 //=================================================================================
611 void SMESHGUI_MergeNodesDlg::SelectionIntoArgument()
613 if (myEditCurrentArgument == (QWidget*)LineEditMesh) {
614 QString aString = "";
615 LineEditMesh->setText(aString);
617 ListCoincident->clear();
620 int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
625 mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
627 Handle(SALOME_InteractiveObject) IO = aList.First();
628 myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
629 myActor = SMESH::FindActorByEntry(aList.First()->getEntry());
630 if (myMesh->_is_nil() || !myActor)
633 LineEditMesh->setText(aString);
637 //=================================================================================
638 // function : DeactivateActiveDialog()
640 //=================================================================================
641 void SMESHGUI_MergeNodesDlg::DeactivateActiveDialog()
643 if (GroupConstructors->isEnabled()) {
644 GroupConstructors->setEnabled(false);
645 GroupMesh->setEnabled(false);
646 GroupCoincident->setEnabled(false);
647 GroupEdit->setEnabled(false);
648 GroupButtons->setEnabled(false);
649 mySMESHGUI->ResetState();
650 mySMESHGUI->SetActiveDialogBox(0);
654 //=================================================================================
655 // function : ActivateThisDialog()
657 //=================================================================================
658 void SMESHGUI_MergeNodesDlg::ActivateThisDialog()
660 /* Emit a signal to deactivate the active dialog */
661 mySMESHGUI->EmitSignalDeactivateDialog();
662 GroupConstructors->setEnabled(true);
663 GroupMesh->setEnabled(true);
664 GroupCoincident->setEnabled(true);
665 GroupEdit->setEnabled(true);
666 GroupButtons->setEnabled(true);
668 mySMESHGUI->SetActiveDialogBox((QDialog*)this);
670 SelectionIntoArgument();
673 //=================================================================================
674 // function : enterEvent()
676 //=================================================================================
677 void SMESHGUI_MergeNodesDlg::enterEvent (QEvent*)
679 if (!GroupConstructors->isEnabled())
680 ActivateThisDialog();
683 //=================================================================================
684 // function : closeEvent()
686 //=================================================================================
687 void SMESHGUI_MergeNodesDlg::closeEvent (QCloseEvent*)
689 /* same than click on cancel button */
693 //=======================================================================
694 //function : hideEvent()
695 //purpose : caused by ESC key
696 //=======================================================================
697 void SMESHGUI_MergeNodesDlg::hideEvent (QHideEvent*)