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);
248 mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
250 mySMESHGUI->SetActiveDialogBox((QDialog*)this);
252 myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
254 /* signals and slots connections */
255 connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
256 connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
257 connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
259 connect(SelectMeshButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
260 connect(DetectButton, SIGNAL (clicked()), this, SLOT(onDetect()));
261 connect(ListCoincident, SIGNAL (selectionChanged()), this, SLOT(onSelectNodesGroup()));
262 connect(ListCoincident, SIGNAL (pressed(QListViewItem*)), this, SLOT(updateControls()));
263 connect(ListCoincident, SIGNAL (currentChanged(QListViewItem*)), this, SLOT(updateControls()));
264 connect(SelectAllCB, SIGNAL(toggled(bool)), this, SLOT(onSelectAll(bool)));
265 connect(ListEdit, SIGNAL (selectionChanged()), this, SLOT(onSelectNodesFromGroup()));
266 connect(AddButton, SIGNAL (clicked()), this, SLOT(onAdd()));
267 connect(RemoveButton, SIGNAL (clicked()), this, SLOT(onRemove()));
269 connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
270 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
271 /* to close dialog if study change */
272 connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
274 /* Move widget on the botton right corner of main widget */
276 mySMESHGUI->DefineDlgPosition(this, x, y);
278 this->show(); /* displays Dialog */
281 buttonOk->setEnabled(false);
282 buttonApply->setEnabled(false);
285 //=================================================================================
286 // function : ~SMESHGUI_MergeNodesDlg()
287 // purpose : Destroys the object and frees any allocated resources
288 //=================================================================================
289 SMESHGUI_MergeNodesDlg::~SMESHGUI_MergeNodesDlg()
291 // no need to delete child widgets, Qt does it all for us
294 //=================================================================================
295 // function : ClickOnApply()
297 //=================================================================================
298 bool SMESHGUI_MergeNodesDlg::ClickOnApply()
300 if (mySMESHGUI->isActiveStudyLocked() || myMesh->_is_nil())
304 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
306 QApplication::setOverrideCursor(Qt::waitCursor);
307 SMESH::array_of_long_array_var aGroupsOfNodes = new SMESH::array_of_long_array;
308 aGroupsOfNodes->length(ListCoincident->childCount());
309 QListViewItem* item = ListCoincident->firstChild();
313 QStringList aListIds = QStringList("");
314 if (((QCheckListItem*) item)->isOn())
315 aListIds = QStringList::split(" ", item->text(0), false);
317 SMESH::long_array_var anIds = new SMESH::long_array;
318 anIds->length(aListIds.count());
320 for (int i = 0; i < aListIds.count(); i++)
321 anIds[i] = aListIds[i].toInt();
323 aGroupsOfNodes[anArrayNum++] = anIds.inout();
325 item = item->itemBelow();
328 aMeshEditor->MergeNodes (aGroupsOfNodes.inout());
329 QApplication::restoreOverrideCursor();
333 mySelectionMgr->clearSelected();
340 //=================================================================================
341 // function : ClickOnOk()
343 //=================================================================================
344 void SMESHGUI_MergeNodesDlg::ClickOnOk()
350 //=================================================================================
351 // function : ClickOnCancel()
353 //=================================================================================
354 void SMESHGUI_MergeNodesDlg::ClickOnCancel()
356 mySelectionMgr->clearFilters();
357 mySelectionMgr->clearSelected();
358 SMESH::SetPointRepresentation(false);
359 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
360 aViewWindow->SetSelectionMode(ActorSelection);
361 disconnect(mySelectionMgr, 0, this, 0);
362 mySMESHGUI->ResetState();
366 //=================================================================================
367 // function : onEditNodesGroup()
369 //=================================================================================
370 void SMESHGUI_MergeNodesDlg::onEditNodesGroup()
372 if (ListCoincident->childCount() < 1)
375 QString aNewIds = "";
377 QListBoxItem* anItem;
378 for (anItem = ListEdit->firstItem(); anItem != 0; anItem = anItem->next())
379 aNewIds+=QString(" %1").arg(anItem->text());
381 ListCoincident->currentItem()->setText(0, aNewIds);
384 //=================================================================================
385 // function : updateControls()
387 //=================================================================================
388 void SMESHGUI_MergeNodesDlg::updateControls()
390 if (ListCoincident->childCount() < 1) {
391 SMESH::SetPointRepresentation(false);
392 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
393 aViewWindow->SetSelectionMode(ActorSelection);
397 bool hasChecked = false, hasUnchecked = false;
399 QListViewItem* item = ListCoincident->firstChild();
401 while (item && (!hasChecked || !hasUnchecked)) {
402 if (((QCheckListItem*) item)->isOn())
407 item = item->itemBelow();
411 SelectAllCB->setChecked(false);
413 bool enable = !(myMesh->_is_nil()) && hasChecked;
415 buttonOk->setEnabled(enable);
416 buttonApply->setEnabled(enable);
419 //=================================================================================
420 // function : onDetect()
422 //=================================================================================
423 void SMESHGUI_MergeNodesDlg::onDetect()
425 if (myMesh->_is_nil())
429 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
431 QApplication::setOverrideCursor(Qt::waitCursor);
432 ListCoincident->clear();
435 SMESH::array_of_long_array_var aNodeGroups;
436 aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aNodeGroups);
438 for (int i = 0; i < aNodeGroups->length(); i++) {
439 SMESH::long_array& aGroup = aNodeGroups[i];
442 for (int j = 0; j < aGroup.length(); j++)
443 aNodeIds+=QString(" %1").arg(aGroup[j]);
445 new QCheckListItem (ListCoincident, aNodeIds, QCheckListItem::CheckBox);
447 QApplication::restoreOverrideCursor();
454 //=================================================================================
455 // function : onSelectNodesGroup()
457 //=================================================================================
458 void SMESHGUI_MergeNodesDlg::onSelectNodesGroup()
463 myEditCurrentArgument = (QWidget*)ListCoincident;
465 QListViewItem* aSelectedItem = ListCoincident->selectedItem();
469 QStringList aListId = QStringList::split(" ", aSelectedItem->text(0), false);
472 ListEdit->insertStringList(aListId);
474 //mySelectionMgr->clearSelected();
475 //mySelectionMgr->AddIObject(myActor->getIO());
477 aList.Append(myActor->getIO());
478 mySelectionMgr->setSelectedObjects(aList, false);
480 SMESH::SetPointRepresentation(true);
481 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
482 aViewWindow->SetSelectionMode(NodeSelection);
484 ListEdit->selectAll(true);
487 //=================================================================================
488 // function : onSelectAll()
490 //=================================================================================
491 void SMESHGUI_MergeNodesDlg::onSelectAll (bool isToggled)
495 QListViewItem* item = ListCoincident->firstChild();
498 if (!((QCheckListItem*) item)->isOn())
499 ((QCheckListItem*) item)->setOn(true);
500 item = item->itemBelow();
504 buttonOk->setEnabled(true);
505 buttonApply->setEnabled(true);
510 //=================================================================================
511 // function : onSelectNodesFromGroup()
513 //=================================================================================
514 void SMESHGUI_MergeNodesDlg::onSelectNodesFromGroup()
519 TColStd_MapOfInteger aIndexes;
520 QListBoxItem* anItem;
521 for (anItem = ListEdit->firstItem(); anItem != 0; anItem = anItem->next()) {
522 if (anItem->isSelected()) {
523 int anId = anItem->text().toInt();
528 mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
530 aList.Append(myActor->getIO());
531 mySelectionMgr->setSelectedObjects(aList);
534 //=================================================================================
535 // function : onAdd()
537 //=================================================================================
538 void SMESHGUI_MergeNodesDlg::onAdd()
543 QString aListStr = "";
546 aNbNnodes = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
550 QStringList aNodes = QStringList::split(" ", aListStr);
551 QListBoxItem* anItem = 0;
553 for (QStringList::iterator it = aNodes.begin(); it != aNodes.end(); ++it) {
554 anItem = ListEdit->findItem(*it, Qt::ExactMatch);
556 anItem = new QListBoxText(*it);
557 ListEdit->insertItem(anItem);
559 ListEdit->setSelected(anItem, true);
565 //=================================================================================
566 // function : onRemove()
568 //=================================================================================
569 void SMESHGUI_MergeNodesDlg::onRemove()
571 if (myEditCurrentArgument != (QWidget*)ListCoincident)
574 for (int i = ListEdit->count(); i > 0; i--) {
575 if (ListEdit->isSelected(i-1))
576 ListEdit->removeItem(i-1);
581 //=================================================================================
582 // function : SetEditCurrentArgument()
584 //=================================================================================
585 void SMESHGUI_MergeNodesDlg::SetEditCurrentArgument()
587 QPushButton* send = (QPushButton*)sender();
589 disconnect(mySelectionMgr, 0, this, 0);
590 mySelectionMgr->clearSelected();
591 mySelectionMgr->clearFilters();
593 if (send == SelectMeshButton) {
594 myEditCurrentArgument = (QWidget*)LineEditMesh;
595 SMESH::SetPointRepresentation(false);
596 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
597 aViewWindow->SetSelectionMode(ActorSelection);
598 mySelectionMgr->installFilter(myMeshOrSubMeshFilter);
601 myEditCurrentArgument->setFocus();
602 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
603 SelectionIntoArgument();
606 //=================================================================================
607 // function : SelectionIntoArgument()
608 // purpose : Called when selection as changed or other case
609 //=================================================================================
610 void SMESHGUI_MergeNodesDlg::SelectionIntoArgument()
612 if (myEditCurrentArgument == (QWidget*)LineEditMesh) {
613 QString aString = "";
614 LineEditMesh->setText(aString);
616 ListCoincident->clear();
619 int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
624 mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
626 Handle(SALOME_InteractiveObject) IO = aList.First();
627 myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
628 myActor = SMESH::FindActorByEntry(aList.First()->getEntry());
629 if (myMesh->_is_nil() || !myActor)
632 LineEditMesh->setText(aString);
636 //=================================================================================
637 // function : DeactivateActiveDialog()
639 //=================================================================================
640 void SMESHGUI_MergeNodesDlg::DeactivateActiveDialog()
642 if (GroupConstructors->isEnabled()) {
643 GroupConstructors->setEnabled(false);
644 GroupMesh->setEnabled(false);
645 GroupCoincident->setEnabled(false);
646 GroupEdit->setEnabled(false);
647 GroupButtons->setEnabled(false);
648 mySMESHGUI->ResetState();
649 mySMESHGUI->SetActiveDialogBox(0);
653 //=================================================================================
654 // function : ActivateThisDialog()
656 //=================================================================================
657 void SMESHGUI_MergeNodesDlg::ActivateThisDialog()
659 /* Emit a signal to deactivate the active dialog */
660 mySMESHGUI->EmitSignalDeactivateDialog();
661 GroupConstructors->setEnabled(true);
662 GroupMesh->setEnabled(true);
663 GroupCoincident->setEnabled(true);
664 GroupEdit->setEnabled(true);
665 GroupButtons->setEnabled(true);
667 mySMESHGUI->SetActiveDialogBox((QDialog*)this);
669 SelectionIntoArgument();
672 //=================================================================================
673 // function : enterEvent()
675 //=================================================================================
676 void SMESHGUI_MergeNodesDlg::enterEvent (QEvent*)
678 if (!GroupConstructors->isEnabled())
679 ActivateThisDialog();
682 //=================================================================================
683 // function : closeEvent()
685 //=================================================================================
686 void SMESHGUI_MergeNodesDlg::closeEvent (QCloseEvent*)
688 /* same than click on cancel button */
692 //=======================================================================
693 //function : hideEvent()
694 //purpose : caused by ESC key
695 //=======================================================================
696 void SMESHGUI_MergeNodesDlg::hideEvent (QHideEvent*)