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.salome-platform.org or email : webmaster.salome@opencascade.org
24 // File : SMESHGUI_GroupDlg.cxx
25 // Author : Natalia KOPNOVA
29 #include "SMESHGUI_GroupDlg.h"
30 #include "SMESHGUI_FilterDlg.h"
33 #include "SMESHGUI_Utils.h"
34 #include "SMESHGUI_VTKUtils.h"
35 #include "SMESHGUI_MeshUtils.h"
36 #include "SMESHGUI_GroupUtils.h"
37 #include "SMESHGUI_FilterUtils.h"
38 #include "SMESHGUI_GEOMGenUtils.h"
40 #include "SMESH_TypeFilter.hxx"
41 #include "SMESH_Actor.h"
44 #include "SUIT_Desktop.h"
45 #include "SUIT_ResourceMgr.h"
47 #include "SalomeApp_Tools.h"
48 #include "SALOMEDSClient_Study.hxx"
49 #include "SALOME_ListIO.hxx"
50 #include "SALOME_ListIteratorOfListIO.hxx"
52 #include "SVTK_ViewWindow.h"
53 #include "SVTK_Selector.h"
55 #include "utilities.h"
58 #include <TColStd_MapOfInteger.hxx>
61 #include <qbuttongroup.h>
62 #include <qgroupbox.h>
65 #include <qlineedit.h>
66 #include <qpushbutton.h>
67 #include <qradiobutton.h>
68 #include <qcheckbox.h>
73 #include <qmemarray.h>
74 #include <qwidgetstack.h>
82 //=================================================================================
83 // function : SMESHGUI_GroupDlg()
85 //=================================================================================
86 SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
87 SMESH::SMESH_Mesh_ptr theMesh, bool modal, WFlags fl)
88 : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
89 WStyle_Title | WStyle_SysMenu | WDestructiveClose),
90 mySMESHGUI( theModule ),
91 mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
92 myViewWindow( SMESH::GetViewWindow( theModule ) ),
93 mySelector( myViewWindow->GetSelector() ),
96 if (!name) setName("SMESHGUI_GroupDlg");
98 if (!theMesh->_is_nil())
101 mySelectSubMesh->setEnabled(false);
102 mySelectGroup->setEnabled(false);
103 myGeomGroupBtn->setEnabled(false);
104 myGeomGroupLine->setEnabled(false);
107 /* Move widget on the botton right corner of main widget */
109 mySMESHGUI->DefineDlgPosition(this, x, y);
113 //=================================================================================
114 // function : SMESHGUI_GroupDlg()
116 //=================================================================================
117 SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
118 SMESH::SMESH_Group_ptr theGroup, bool modal, WFlags fl)
119 : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
120 WStyle_Title | WStyle_SysMenu | WDestructiveClose),
121 mySMESHGUI( theModule ),
122 mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
123 myViewWindow( SMESH::GetViewWindow( theModule ) ),
124 mySelector( myViewWindow->GetSelector() ),
127 if (!name) setName("SMESHGUI_GroupDlg");
129 if (!theGroup->_is_nil())
132 mySelectSubMesh->setEnabled(false);
133 mySelectGroup->setEnabled(false);
136 /* Move widget on the botton right corner of main widget */
138 mySMESHGUI->DefineDlgPosition(this, x, y);
142 //=================================================================================
143 // function : SMESHGUI_GroupDlg()
145 //=================================================================================
146 void SMESHGUI_GroupDlg::initDialog(bool create)
150 myCurrentLineEdit = 0;
152 QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
155 setCaption(tr("SMESH_CREATE_GROUP_TITLE"));
157 setCaption(tr("SMESH_EDIT_GROUP_TITLE"));
159 setSizeGripEnabled(TRUE);
161 QGridLayout* aMainLayout = new QGridLayout(this, 7, 3, 11, 6);
163 /***************************************************************/
164 QLabel* meshGroupLab = new QLabel(this, "mesh/group label");
166 meshGroupLab->setText(tr("SMESH_MESH"));
168 meshGroupLab->setText(tr("SMESH_GROUP"));
169 myMeshGroupBtn = new QPushButton(this, "mesh/group button");
170 myMeshGroupBtn->setPixmap(image0);
171 myMeshGroupLine = new QLineEdit(this, "mesh/group line");
172 myMeshGroupLine->setReadOnly(true);
174 /***************************************************************/
175 myTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Group types");
176 myTypeGroup->setTitle(tr("SMESH_ELEMENTS_TYPE"));
177 myTypeGroup->setExclusive(true);
180 types.append(tr("MESH_NODE"));
181 types.append(tr("SMESH_EDGE"));
182 types.append(tr("SMESH_FACE"));
183 types.append(tr("SMESH_VOLUME"));
185 for (int i = 0; i < types.count(); i++) {
186 rb = new QRadioButton(types[i], myTypeGroup);
188 myTypeGroup->setEnabled(create);
191 /***************************************************************/
192 QLabel* aName = new QLabel(this, "name label");
193 aName->setText(tr("SMESH_NAME"));
194 aName->setMinimumSize(50,0);
195 myName = new QLineEdit(this, "name");
197 /***************************************************************/
198 myGrpTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Type of group");
199 myGrpTypeGroup->setTitle(tr("SMESH_GROUP_TYPE"));
200 myGrpTypeGroup->setExclusive(true);
201 QRadioButton* rb1 = new QRadioButton( tr("SMESH_GROUP_STANDALONE"), myGrpTypeGroup);
202 QRadioButton* rb2 = new QRadioButton( tr("SMESH_GROUP_GEOMETRY"), myGrpTypeGroup);
203 myGrpTypeGroup->setEnabled(create);
206 /***************************************************************/
207 myWGStack = new QWidgetStack( this, "widget stack");
208 QWidget* wg1 = new QFrame( myWGStack, "first widget" );
209 QWidget* wg2 = new QFrame( myWGStack, "second widget" );
211 /***************************************************************/
212 QGroupBox* aContentBox = new QGroupBox(1, Qt::Horizontal, wg1, "content box");
213 aContentBox->setTitle(tr("SMESH_CONTENT"));
214 QFrame* aContent = new QFrame(aContentBox, "content");
215 QGridLayout* aLayout = new QGridLayout(aContent, 7, 4);
216 aLayout->setSpacing(6);
217 aLayout->setAutoAdd(false);
219 QLabel* aLabel = new QLabel(aContent, "elements label");
220 aLabel->setText(tr("SMESH_ID_ELEMENTS"));
221 myElements = new QListBox(aContent, "elements list");
222 myElements->setSelectionMode(QListBox::Extended);
224 myFilter = new QPushButton(aContent, "filter");
225 myFilter->setText(tr("SMESH_BUT_FILTER"));
226 QPushButton* aAddBtn = new QPushButton(aContent, "add");
227 aAddBtn->setText(tr("SMESH_BUT_ADD"));
228 QPushButton* aRemoveBtn = new QPushButton(aContent, "remove");
229 aRemoveBtn->setText(tr("SMESH_BUT_REMOVE"));
230 QPushButton* aSortBtn = new QPushButton(aContent, "sort");
231 aSortBtn->setText(tr("SMESH_BUT_SORT"));
233 aLayout->addWidget(aLabel, 0, 0);
234 aLayout->addMultiCellWidget(myElements, 1, 6, 0, 0);
235 aLayout->addWidget(myFilter, 1, 2);
236 aLayout->addWidget(aAddBtn, 3, 2);
237 aLayout->addWidget(aRemoveBtn, 4, 2);
238 aLayout->addWidget(aSortBtn, 6, 2);
240 aLayout->setColStretch(0, 1);
241 aLayout->addColSpacing(1, 20);
242 aLayout->addColSpacing(3, 20);
243 aLayout->setRowStretch(2, 1);
244 aLayout->setRowStretch(5, 1);
246 /***************************************************************/
247 QGroupBox* aSelectBox = new QGroupBox(3, Qt::Horizontal, wg1, "select box");
248 aSelectBox->setTitle(tr("SMESH_SELECT_FROM"));
250 mySelectSubMesh = new QCheckBox(aSelectBox, "submesh checkbox");
251 mySelectSubMesh->setText(tr("SMESH_SUBMESH"));
252 mySelectSubMesh->setMinimumSize(50, 0);
253 mySubMeshBtn = new QPushButton(aSelectBox, "submesh button");
254 mySubMeshBtn->setText("");
255 mySubMeshBtn->setPixmap(image0);
256 mySubMeshLine = new QLineEdit(aSelectBox, "submesh line");
257 mySubMeshLine->setReadOnly(true);
258 onSelectSubMesh(false);
260 mySelectGroup = new QCheckBox(aSelectBox, "group checkbox");
261 mySelectGroup->setText(tr("SMESH_GROUP"));
262 mySelectGroup->setMinimumSize(50, 0);
263 myGroupBtn = new QPushButton(aSelectBox, "group button");
264 myGroupBtn->setText("");
265 myGroupBtn->setPixmap(image0);
266 myGroupLine = new QLineEdit(aSelectBox, "group line");
267 myGroupLine->setReadOnly(true);
268 onSelectGroup(false);
270 /***************************************************************/
271 QGridLayout* wg1Layout = new QGridLayout( wg1, 3, 1, 0, 6 );
272 wg1Layout->addWidget(aContentBox, 0, 0);
273 wg1Layout->addWidget(aSelectBox, 1, 0);
274 wg1Layout->setRowStretch(2, 5);
276 /***************************************************************/
277 QLabel* geomObject = new QLabel(wg2, "geometry object label");
278 geomObject->setText(tr("SMESH_OBJECT_GEOM"));
279 myGeomGroupBtn = new QPushButton(wg2, "geometry group button");
280 myGeomGroupBtn->setText("");
281 myGeomGroupBtn->setPixmap(image0);
282 myGeomGroupLine = new QLineEdit(wg2, "geometry group line");
283 myGeomGroupLine->setReadOnly(true); //VSR ???
284 onSelectGeomGroup(false);
286 /***************************************************************/
287 QGridLayout* wg2Layout = new QGridLayout( wg2, 2, 3, 0, 6 );
288 wg2Layout->addWidget(geomObject, 0, 0);
289 wg2Layout->addWidget(myGeomGroupBtn, 0, 1);
290 wg2Layout->addWidget(myGeomGroupLine,0, 2);
291 wg2Layout->setRowStretch(1, 5);
293 /***************************************************************/
294 QVBoxLayout* dumb = new QVBoxLayout(myWGStack);
295 dumb->addWidget(wg1);
296 dumb->addWidget(wg2);
297 myWGStack->addWidget( wg1, myGrpTypeGroup->id(rb1) );
298 myWGStack->addWidget( wg2, myGrpTypeGroup->id(rb2) );
300 /***************************************************************/
301 QFrame* aButtons = new QFrame(this, "button box");
302 aButtons->setFrameStyle(QFrame::Box | QFrame::Sunken);
303 QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons, 11, 6);
304 aBtnLayout->setAutoAdd(false);
306 QPushButton* aOKBtn = new QPushButton(aButtons, "ok");
307 aOKBtn->setText(tr("SMESH_BUT_OK"));
308 aOKBtn->setAutoDefault(true);
309 aOKBtn->setDefault(true);
310 QPushButton* aApplyBtn = new QPushButton(aButtons, "apply");
311 aApplyBtn->setText(tr("SMESH_BUT_APPLY"));
312 aApplyBtn->setAutoDefault(true);
313 QPushButton* aCloseBtn = new QPushButton(aButtons, "close");
314 aCloseBtn->setText(tr("SMESH_BUT_CLOSE"));
315 aCloseBtn->setAutoDefault(true);
317 aBtnLayout->addWidget(aOKBtn);
318 aBtnLayout->addWidget(aApplyBtn);
319 aBtnLayout->addStretch();
320 aBtnLayout->addWidget(aCloseBtn);
322 /***************************************************************/
323 aMainLayout->addWidget(meshGroupLab, 0, 0);
324 aMainLayout->addWidget(myMeshGroupBtn, 0, 1);
325 aMainLayout->addWidget(myMeshGroupLine, 0, 2);
326 aMainLayout->addMultiCellWidget(myTypeGroup, 1, 1, 0, 2);
327 aMainLayout->addWidget(aName, 2, 0);
328 aMainLayout->addWidget(myName, 2, 2);
329 aMainLayout->addMultiCellWidget(myGrpTypeGroup, 3, 3, 0, 2);
330 aMainLayout->addMultiCellWidget(myWGStack, 4, 4, 0, 2);
331 aMainLayout->setRowStretch( 5, 5 );
332 aMainLayout->addMultiCellWidget(aButtons, 6, 6, 0, 2);
334 /* signals and slots connections */
335 connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
337 connect(myGrpTypeGroup, SIGNAL(clicked(int)), this, SLOT(onGrpTypeChanged(int)));
339 connect(myTypeGroup, SIGNAL(clicked(int)), this, SLOT(onTypeChanged(int)));
341 connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
342 connect(myElements, SIGNAL(selectionChanged()), this, SLOT(onListSelectionChanged()));
344 connect(myFilter, SIGNAL(clicked()), this, SLOT(setFilters()));
345 connect(aAddBtn, SIGNAL(clicked()), this, SLOT(onAdd()));
346 connect(aRemoveBtn, SIGNAL(clicked()), this, SLOT(onRemove()));
347 connect(aSortBtn, SIGNAL(clicked()), this, SLOT(onSort()));
349 connect(mySelectSubMesh, SIGNAL(toggled(bool)), this, SLOT(onSelectSubMesh(bool)));
350 connect(mySelectGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool)));
351 connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
352 connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
353 connect(myGeomGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
355 connect(aOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
356 connect(aApplyBtn, SIGNAL(clicked()), this, SLOT(onApply()));
357 connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(onClose()));
360 mySMESHGUI->SetActiveDialogBox(this);
361 mySMESHGUI->SetState(800);
363 mySelectionMode = -1;
364 myMeshFilter = new SMESH_TypeFilter(MESH);
365 mySubMeshFilter = new SMESH_TypeFilter(SUBMESH);
366 myGroupFilter = new SMESH_TypeFilter(GROUP);
368 connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
369 connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onClose()));
370 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged()));
372 myGrpTypeGroup->setButton(myGrpTypeGroup->id(rb1)); // VSR !!!
373 onGrpTypeChanged(myGrpTypeGroup->id(rb1)); // VSR!!!
375 if (myMesh->_is_nil() )
376 myTypeGroup->setButton(0);
381 //=================================================================================
382 // function : ~SMESHGUI_GroupDlg()
383 // purpose : Destroys the object and frees any allocated resources
384 //=================================================================================
385 SMESHGUI_GroupDlg::~SMESHGUI_GroupDlg()
387 // no need to delete child widgets, Qt does it all for us
388 if ( myFilterDlg != 0 )
390 myFilterDlg->reparent( 0, QPoint() );
395 //=================================================================================
398 //=================================================================================
399 void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
401 mySelectionMgr->installFilter(myMeshFilter);
403 /* init data from current selection */
404 myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
405 myGroup = SMESH::SMESH_Group::_nil();
407 myActor = SMESH::FindActorByObject(myMesh);
408 SMESH::SetPickable(myActor);
411 mySelectionMgr->selectedObjects( aList );
412 if( !aList.IsEmpty() )
414 QString aName = aList.First()->getName();
415 myMeshGroupLine->setText(aName) ;
416 myMeshGroupLine->home( false );
419 myCurrentLineEdit = 0;
421 myTypeGroup->setButton(0);
425 //=================================================================================
428 //=================================================================================
429 void SMESHGUI_GroupDlg::init (SMESH::SMESH_Group_ptr theGroup)
431 myMesh = theGroup->GetMesh();
432 myGroup = SMESH::SMESH_Group::_duplicate(theGroup);
434 myActor = SMESH::FindActorByObject(myMesh);
436 myActor = SMESH::FindActorByObject(myGroup);
437 SMESH::SetPickable(myActor);
440 switch(theGroup->GetType()) {
441 case SMESH::NODE: aType= 0; break;
442 case SMESH::EDGE: aType = 1; break;
443 case SMESH::FACE: aType = 2; break;
444 case SMESH::VOLUME: aType = 3; break;
447 myName->setText(myGroup->GetName());
449 myMeshGroupLine->setText(myGroup->GetName());
451 myCurrentLineEdit = 0;
452 myTypeGroup->setButton(aType);
454 setSelectionMode(aType);
458 if (!theGroup->IsEmpty()) {
459 SMESH::long_array_var anElements = myGroup->GetListOfID();
460 int k = anElements->length();
461 for (int i = 0; i < k; i++) {
462 myIdList.append(anElements[i]);
463 myElements->insertItem(QString::number(anElements[i]));
465 myElements->selectAll(true);
469 //=================================================================================
470 // function : updateButtons()
472 //=================================================================================
473 void SMESHGUI_GroupDlg::updateButtons()
477 if (myGrpTypeId == 0)
478 enable = !myName->text().stripWhiteSpace().isEmpty() && myElements->count() > 0;
479 else if (myGrpTypeId == 1)
480 enable = !myName->text().stripWhiteSpace().isEmpty() && !CORBA::is_nil( myGeomGroup );
482 aBtn = (QPushButton*) child("ok", "QPushButton");
483 if (aBtn) aBtn->setEnabled(enable);
484 aBtn = (QPushButton*) child("apply", "QPushButton");
485 if (aBtn) aBtn->setEnabled(enable);
488 //=================================================================================
489 // function : onNameChanged()
491 //=================================================================================
492 void SMESHGUI_GroupDlg::onNameChanged (const QString& text)
497 //=================================================================================
498 // function : onTypeChanged()
499 // purpose : Group elements type radio button management
500 //=================================================================================
501 void SMESHGUI_GroupDlg::onTypeChanged (int id)
503 if (myTypeId != id) {
505 if (myCurrentLineEdit == 0)
506 setSelectionMode(id);
511 //=================================================================================
512 // function : onGrpTypeChanged()
513 // purpose : Group type radio button management
514 //=================================================================================
515 void SMESHGUI_GroupDlg::onGrpTypeChanged (int id)
517 if (myGrpTypeId != id) {
518 myWGStack->raiseWidget( id );
519 onSelectGeomGroup(id == 1);
524 //=================================================================================
525 // function : setSelectionMode()
526 // purpose : Radio button management
527 //=================================================================================
528 void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
531 if (myMesh->_is_nil())
534 if (mySelectionMode != theMode) {
535 mySelectionMgr->clearSelected();
536 mySelectionMgr->clearFilters();
537 SMESH::SetPointRepresentation(false);
542 myActor->SetPointRepresentation(true);
544 SMESH::SetPointRepresentation(true);
545 myViewWindow->SetSelectionMode(NodeSelection);
548 myViewWindow->SetSelectionMode(EdgeSelection);
551 myViewWindow->SetSelectionMode(FaceSelection);
554 myViewWindow->SetSelectionMode(VolumeSelection);
557 myViewWindow->SetSelectionMode(ActorSelection);
559 mySelectionMgr->installFilter(mySubMeshFilter);
560 else if (theMode == 5)
561 mySelectionMgr->installFilter(myGroupFilter);
562 else if (theMode == 6)
563 mySelectionMgr->installFilter(myMeshFilter);
565 mySelectionMode = theMode;
569 //=================================================================================
570 // function : onApply()
572 //=================================================================================
573 bool SMESHGUI_GroupDlg::onApply()
575 if (mySMESHGUI->isActiveStudyLocked())
578 if (myGrpTypeId == 0 &&
579 !myName->text().stripWhiteSpace().isEmpty() &&
580 myElements->count() > 0) {
581 mySelectionMgr->clearSelected();
582 if (myGroup->_is_nil()) {
583 SMESH::ElementType aType = SMESH::ALL;
585 case 0: aType = SMESH::NODE; break;
586 case 1: aType = SMESH::EDGE; break;
587 case 2: aType = SMESH::FACE; break;
588 case 3: aType = SMESH::VOLUME; break;
590 SMESH::long_array_var anIdList = new SMESH::long_array;
591 int i, k = myElements->count();
593 QListBoxItem* anItem;
594 for (i = 0, anItem = myElements->firstItem(); anItem != 0; i++, anItem = anItem->next()) {
595 anIdList[i] = anItem->text().toInt();
598 myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
599 myGroup->Add(anIdList.inout());
601 /* init for next operation */
604 myGroup = SMESH::SMESH_Group::_nil();
607 myGroup->SetName(myName->text());
609 QValueList<int> aAddList;
610 QValueList<int>::iterator anIt;
611 QListBoxItem* anItem;
613 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
614 int anId = anItem->text().toInt();
615 if ((anIt = myIdList.find(anId)) == myIdList.end())
616 aAddList.append(anId);
618 myIdList.remove(anIt);
620 if (!aAddList.empty()) {
621 SMESH::long_array_var anIdList = new SMESH::long_array;
622 anIdList->length(aAddList.count());
624 for (i = 0, anIt = aAddList.begin(); anIt != aAddList.end(); anIt++, i++)
626 myGroup->Add(anIdList.inout());
628 if (!myIdList.empty()) {
629 SMESH::long_array_var anIdList = new SMESH::long_array;
630 anIdList->length(myIdList.count());
632 for (i = 0, anIt = myIdList.begin(); anIt != myIdList.end(); anIt++, i++)
634 myGroup->Remove(anIdList.inout());
636 /* init for next operation */
638 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next())
639 myIdList.append(anItem->text().toInt());
642 mySMESHGUI->updateObjBrowser(true);
643 SMESH::UpdateView(); // asv: fix of BUG PAL5515
644 mySelectionMgr->clearSelected();
646 } else if (myGrpTypeId == 1 &&
647 !myName->text().stripWhiteSpace().isEmpty() &&
648 !CORBA::is_nil(myGeomGroup))
650 SMESH::ElementType aType = SMESH::ALL;
652 case 0: aType = SMESH::NODE; break;
653 case 1: aType = SMESH::EDGE; break;
654 case 2: aType = SMESH::FACE; break;
655 case 3: aType = SMESH::VOLUME; break;
658 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
659 GEOM::GEOM_IGroupOperations_var aGroupOp =
660 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
662 SMESH::SMESH_GroupOnGeom_var aGroupOnGeom =
663 myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomGroup);
665 mySMESHGUI->updateObjBrowser(true);
666 mySelectionMgr->clearSelected();
667 /* init for next operation */
675 //=================================================================================
678 //=================================================================================
679 void SMESHGUI_GroupDlg::onOK()
685 //=================================================================================
686 // function : onListSelectionChanged()
687 // purpose : Called when selection in element list is changed
688 //=================================================================================
689 void SMESHGUI_GroupDlg::onListSelectionChanged()
691 // MESSAGE("SMESHGUI_GroupDlg::onListSelectionChanged(); myActor = " << myActor);
692 if( myIsBusy || !myActor) return;
695 if (myCurrentLineEdit == 0) {
696 mySelectionMgr->clearSelected();
697 TColStd_MapOfInteger aIndexes;
698 QListBoxItem* anItem;
699 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
700 if (anItem->isSelected()) {
701 int anId = anItem->text().toInt();
705 mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
707 aList.Append(myActor->getIO());
708 mySelectionMgr->setSelectedObjects(aList,false);
709 myViewWindow->highlight( myActor->getIO(), true, true );
714 //=================================================================================
715 // function : onObjectSelectionChanged()
716 // purpose : Called when selection in 3D view or ObjectBrowser is changed
717 //=================================================================================
718 void SMESHGUI_GroupDlg::onObjectSelectionChanged()
720 if ( myIsBusy || !isEnabled()) return;
724 mySelectionMgr->selectedObjects( aList );
726 int aNbSel = aList.Extent();
727 myElements->clearSelection();
729 if (myCurrentLineEdit) {
730 myCurrentLineEdit->setText("");
731 QString aString = "";
733 if (myCurrentLineEdit == myMeshGroupLine) {
734 mySelectSubMesh->setEnabled(false);
735 mySelectGroup->setEnabled(false);
736 myGroupLine->setText("");
737 mySubMeshLine->setText("");
739 myGeomGroupBtn->setEnabled(false);
740 myGeomGroupLine->setEnabled(false);
741 myGeomGroupLine->setText("");
748 myGroup = SMESH::SMESH_Group::_nil();
749 myMesh = SMESH::SMESH_Mesh::_nil();
753 Handle(SALOME_InteractiveObject) IO = aList.First();
756 myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
757 if (myMesh->_is_nil())
762 myGroup = SMESH::SMESH_Group::_nil();
764 myActor = SMESH::FindActorByObject(myMesh);
765 SMESH::SetPickable(myActor);
767 aString = aList.First()->getName();
768 myMeshGroupLine->setText(aString) ;
769 myMeshGroupLine->home( false );
771 mySelectSubMesh->setEnabled(true);
772 mySelectGroup->setEnabled(true);
773 myGeomGroupBtn->setEnabled(true);
774 myGeomGroupLine->setEnabled(true);
777 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(IO);
778 if (aGroup->_is_nil())
784 myCurrentLineEdit = 0;
787 mySelectSubMesh->setEnabled(true);
788 mySelectGroup->setEnabled(true);
789 myGeomGroupBtn->setEnabled(true);
790 myGeomGroupLine->setEnabled(true);
792 myCurrentLineEdit = 0;
801 setSelectionMode(myTypeId);
807 } else if (myCurrentLineEdit == myGeomGroupLine) {
809 myGeomGroup = GEOM::GEOM_Object::_nil();
814 Standard_Boolean testResult = Standard_False;
815 myGeomGroup = GEOMBase::ConvertIOinGEOMObject(aList.First(), testResult);
817 // Check if the object is a geometry group
818 if (!testResult || CORBA::is_nil(myGeomGroup)) {
819 myGeomGroup = GEOM::GEOM_Object::_nil();
823 // Check if group constructed on the same shape as a mesh or on its child
824 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
825 GEOM::GEOM_IGroupOperations_var anOp =
826 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
828 // The main shape of the group
829 GEOM::GEOM_Object_var aGroupMainShape;
830 if (myGeomGroup->GetType() == 37)
831 aGroupMainShape = anOp->GetMainShape(myGeomGroup);
833 aGroupMainShape = GEOM::GEOM_Object::_duplicate(myGeomGroup);
834 _PTR(SObject) aGroupMainShapeSO =
835 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
836 aStudy->FindObjectIOR(aGroupMainShape->GetStudyEntry());
839 _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
841 myGeomGroup = GEOM::GEOM_Object::_nil();
845 _PTR(SObject) anObj, aRef;
846 bool isRefOrSubShape = false;
847 if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) {
848 //if (strcmp(aRef->GetID(), aGroupMainShapeSO->GetID()) == 0) {
849 if (aRef->GetID() == aGroupMainShapeSO->GetID()) {
850 isRefOrSubShape = true;
852 _PTR(SObject) aFather = aGroupMainShapeSO->GetFather();
853 _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent();
854 //while (!isRefOrSubShape && strcmp(aFather->GetID(), aComponent->GetID()) != 0) {
855 while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) {
856 //if (strcmp(aRef->GetID(), aFather->GetID()) == 0)
857 if (aRef->GetID() == aFather->GetID())
858 isRefOrSubShape = true;
860 aFather = aFather->GetFather();
864 if (!isRefOrSubShape) {
865 myGeomGroup = GEOM::GEOM_Object::_nil();
873 if(myCurrentLineEdit == mySubMeshLine)
874 aString = tr("SMESH_SUBMESH_SELECTED").arg(aNbSel);
875 else if(myCurrentLineEdit == myGroupLine || myCurrentLineEdit == myGeomGroupLine)
876 aString = tr("SMESH_GROUP_SELECTED").arg(aNbSel);
878 aString = aList.First()->getName();
882 myCurrentLineEdit->setText(aString);
883 myCurrentLineEdit->home(false);
889 QString aListStr = "";
892 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
894 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
897 QStringList anElements = QStringList::split(" ", aListStr);
898 QListBoxItem* anItem = 0;
899 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
900 anItem = myElements->findItem(*it, Qt::ExactMatch);
901 if (anItem) myElements->setSelected(anItem, true);
908 if (!myGroup->_is_nil())
909 myActor = SMESH::FindActorByObject(myGroup);
911 myActor = SMESH::FindActorByObject(myMesh);
917 //=================================================================================
918 // function : onSelectSubMesh()
919 // purpose : Called when selection in 3D view or ObjectBrowser is changed
920 //=================================================================================
921 void SMESHGUI_GroupDlg::onSelectSubMesh(bool on)
924 if (mySelectGroup->isChecked()) {
925 mySelectGroup->setChecked(false);
927 //VSR: else if (mySelectGeomGroup->isChecked()) {
928 //VSR: mySelectGeomGroup->setChecked(false);
930 myCurrentLineEdit = mySubMeshLine;
934 mySubMeshLine->setText("");
935 myCurrentLineEdit = 0;
937 setSelectionMode(myTypeId);
939 mySubMeshBtn->setEnabled(on);
940 mySubMeshLine->setEnabled(on);
944 //=================================================================================
945 // function : (onSelectGroup)
946 // purpose : Called when selection in 3D view or ObjectBrowser is changed
947 //=================================================================================
948 void SMESHGUI_GroupDlg::onSelectGroup(bool on)
951 if (mySelectSubMesh->isChecked()) {
952 mySelectSubMesh->setChecked(false);
954 myCurrentLineEdit = myGroupLine;
958 myGroupLine->setText("");
959 myCurrentLineEdit = 0;
961 setSelectionMode(myTypeId);
963 myGroupBtn->setEnabled(on);
964 myGroupLine->setEnabled(on);
968 //=================================================================================
969 // function : (onSelectGeomGroup)
970 // purpose : Called when selection in 3D view or ObjectBrowser is changed
971 //=================================================================================
972 void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
975 if (mySelectSubMesh->isChecked()) {
976 mySelectSubMesh->setChecked(false);
978 else if (mySelectGroup->isChecked()) {
979 mySelectGroup->setChecked(false);
981 myCurrentLineEdit = myGeomGroupLine;
985 myGeomGroupLine->setText("");
986 myCurrentLineEdit = 0;
988 setSelectionMode(myTypeId);
993 //=================================================================================
994 // function : setCurrentSelection()
996 //=================================================================================
997 void SMESHGUI_GroupDlg::setCurrentSelection()
999 QPushButton* send = (QPushButton*)sender();
1000 myCurrentLineEdit = 0;
1001 if (send == myMeshGroupBtn) {
1002 myCurrentLineEdit = myMeshGroupLine;
1004 setSelectionMode(6);
1006 setSelectionMode(5);
1007 onObjectSelectionChanged();
1009 else if (send == mySubMeshBtn) {
1010 myCurrentLineEdit = mySubMeshLine;
1011 onObjectSelectionChanged();
1013 else if (send == myGroupBtn) {
1014 myCurrentLineEdit = myGroupLine;
1015 onObjectSelectionChanged();
1017 else if (send == myGeomGroupBtn) {
1018 myCurrentLineEdit = myGeomGroupLine;
1019 setSelectionMode(7);
1020 onObjectSelectionChanged();
1025 //=================================================================================
1026 // function : setFilters()
1027 // purpose : SLOT. Called when "Filter" button pressed.
1028 //=================================================================================
1029 void SMESHGUI_GroupDlg::setFilters()
1031 SMESH::ElementType aType = SMESH::ALL;
1034 case 0 : aType = SMESH::NODE; break;
1035 case 1 : aType = SMESH::EDGE; break;
1036 case 2 : aType = SMESH::FACE; break;
1037 case 3 : aType = SMESH::VOLUME; break;
1041 if ( myFilterDlg == 0 )
1043 myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, aType );
1044 connect( myFilterDlg, SIGNAL( Accepted() ), SLOT( onFilterAccepted() ) );
1047 myFilterDlg->Init( aType );
1049 myFilterDlg->SetSelection();
1050 myFilterDlg->SetMesh( myMesh );
1051 myFilterDlg->SetSourceWg( myElements );
1053 myFilterDlg->show();
1056 //=================================================================================
1057 // function : onFilterAccepted()
1058 // purpose : SLOT. Called when Filter dlg closed with OK button.
1059 // Uncheck "Select submesh" and "Select group" checkboxes
1060 //=================================================================================
1061 void SMESHGUI_GroupDlg::onFilterAccepted()
1063 if ( mySelectSubMesh->isChecked() || mySelectGroup->isChecked() )
1065 mySelectionMode = myTypeId;
1066 mySelectSubMesh->setChecked( false );
1067 mySelectGroup->setChecked( false );
1071 //=================================================================================
1072 // function : onAdd()
1074 //=================================================================================
1075 void SMESHGUI_GroupDlg::onAdd()
1077 SALOME_ListIO aList;
1078 mySelectionMgr->selectedObjects( aList );
1080 int aNbSel = aList.Extent();
1082 if (aNbSel == 0 || !myActor || myMesh->_is_nil()) return;
1086 SMESH::ElementType aType = SMESH::ALL;
1088 case 0: aType = SMESH::NODE; break;
1089 case 1: aType = SMESH::EDGE; break;
1090 case 2: aType = SMESH::FACE; break;
1091 case 3: aType = SMESH::VOLUME; break;
1094 if (myCurrentLineEdit == 0) {
1095 //if (aNbSel != 1) { myIsBusy = false; return; }
1096 QString aListStr = "";
1098 if (myTypeId == 0) {
1099 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
1102 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
1105 QStringList anElements = QStringList::split(" ", aListStr);
1106 QListBoxItem* anItem = 0;
1107 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
1108 anItem = myElements->findItem(*it, Qt::ExactMatch);
1110 anItem = new QListBoxText(*it);
1111 myElements->insertItem(anItem);
1113 myElements->setSelected(anItem, true);
1116 } else if (myCurrentLineEdit == mySubMeshLine) {
1117 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1119 SALOME_ListIO aList;
1120 mySelectionMgr->selectedObjects( aList );
1122 SALOME_ListIteratorOfListIO anIt (aList);
1123 for (; anIt.More(); anIt.Next()) {
1124 SMESH::SMESH_subMesh_var aSubMesh =
1125 SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1126 if (!aSubMesh->_is_nil()) {
1127 // check if mesh is the same
1128 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1130 SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
1131 int k = anElements->length();
1132 QListBoxItem* anItem = 0;
1133 for (int i = 0; i < k; i++) {
1134 QString aText = QString::number(anElements[i]);
1135 anItem = myElements->findItem(aText, Qt::ExactMatch);
1137 anItem = new QListBoxText(aText);
1138 myElements->insertItem(anItem);
1140 myElements->setSelected(anItem, true);
1143 catch (const SALOME::SALOME_Exception& ex) {
1144 SalomeApp_Tools::QtCatchCorbaException(ex);
1149 mySelectSubMesh->setChecked(false);
1151 onListSelectionChanged();
1153 } else if (myCurrentLineEdit == myGroupLine) {
1154 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1155 SALOME_ListIO aList;
1156 mySelectionMgr->selectedObjects( aList );
1158 SALOME_ListIteratorOfListIO anIt (aList);
1159 for (; anIt.More(); anIt.Next()) {
1160 SMESH::SMESH_Group_var aGroup =
1161 SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1162 if (!aGroup->_is_nil()) {
1163 // check if mesh is the same
1164 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1165 SMESH::long_array_var anElements = aGroup->GetListOfID();
1166 int k = anElements->length();
1167 QListBoxItem* anItem = 0;
1168 for (int i = 0; i < k; i++) {
1169 QString aText = QString::number(anElements[i]);
1170 anItem = myElements->findItem(aText, Qt::ExactMatch);
1172 anItem = new QListBoxText(aText);
1173 myElements->insertItem(anItem);
1175 myElements->setSelected(anItem, true);
1180 mySelectGroup->setChecked(false);
1182 onListSelectionChanged();
1184 } else if (myCurrentLineEdit == myGeomGroupLine && !CORBA::is_nil(myGeomGroup)) {
1185 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
1186 GEOM::GEOM_IGroupOperations_var aGroupOp =
1187 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
1189 SMESH::ElementType aGroupType = SMESH::ALL;
1190 switch(aGroupOp->GetType(myGeomGroup)) {
1191 case 7: aGroupType = SMESH::NODE; break;
1192 case 6: aGroupType = SMESH::EDGE; break;
1193 case 4: aGroupType = SMESH::FACE; break;
1194 case 2: aGroupType = SMESH::VOLUME; break;
1195 default: myIsBusy = false; return;
1198 if (aGroupType == aType) {
1199 _PTR(SObject) aGroupSO =
1200 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
1201 aStudy->FindObjectIOR(myGeomGroup->GetStudyEntry());
1203 SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
1204 SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
1205 SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom();;
1206 aBelongToGeom->SetGeom(myGeomGroup);
1207 aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str());
1208 aBelongToGeom->SetElementType(aType);
1209 aFilter->SetPredicate(aBelongToGeom);
1211 SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh);
1213 int k = anElements->length();
1214 QListBoxItem* anItem = 0;
1215 for (int i = 0; i < k; i++) {
1216 QString aText = QString::number(anElements[i]);
1217 anItem = myElements->findItem(aText, Qt::ExactMatch);
1219 anItem = new QListBoxText(aText);
1220 myElements->insertItem(anItem);
1222 myElements->setSelected(anItem, true);
1226 //VSR: mySelectGeomGroup->setChecked(false);
1228 onListSelectionChanged();
1231 // mySelectionMgr->clearSelected();
1235 //=================================================================================
1236 // function : onRemove()
1238 //=================================================================================
1239 void SMESHGUI_GroupDlg::onRemove()
1242 if (myCurrentLineEdit == 0) {
1243 for (int i = myElements->count(); i > 0; i--) {
1244 if (myElements->isSelected(i-1)) {
1245 myElements->removeItem(i-1);
1249 SALOME_ListIO aList;
1250 mySelectionMgr->selectedObjects( aList );
1252 int aNbSel = aList.Extent();
1254 if (aNbSel == 0) { myIsBusy = false; return; }
1256 SMESH::ElementType aType = SMESH::ALL;
1258 case 0: aType = SMESH::NODE; break;
1259 case 1: aType = SMESH::EDGE; break;
1260 case 2: aType = SMESH::FACE; break;
1261 case 3: aType = SMESH::VOLUME; break;
1264 if (myCurrentLineEdit == mySubMeshLine) {
1265 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1266 SALOME_ListIO aList;
1267 mySelectionMgr->selectedObjects( aList );
1269 SALOME_ListIteratorOfListIO anIt (aList);
1270 for (; anIt.More(); anIt.Next()) {
1271 SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1272 if (!aSubMesh->_is_nil()) {
1273 // check if mesh is the same
1274 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1275 if (aType == SMESH::NODE) {
1277 SMESH::long_array_var anElements = aSubMesh->GetNodesId();
1278 int k = anElements->length();
1279 QListBoxItem* anItem = 0;
1280 for (int i = 0; i < k; i++) {
1281 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1282 if (anItem) delete anItem;
1285 catch (const SALOME::SALOME_Exception& ex) {
1286 SalomeApp_Tools::QtCatchCorbaException(ex);
1291 SMESH::long_array_var anElements = aSubMesh->GetElementsId();
1292 int k = anElements->length();
1293 QListBoxItem* anItem = 0;
1294 for (int i = 0; i < k; i++) {
1295 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1296 if (anItem) delete anItem;
1299 catch (const SALOME::SALOME_Exception& ex) {
1300 SalomeApp_Tools::QtCatchCorbaException(ex);
1307 else if (myCurrentLineEdit == myGroupLine) {
1308 Standard_Boolean aRes;
1309 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1310 SALOME_ListIO aList;
1311 mySelectionMgr->selectedObjects( aList );
1313 SALOME_ListIteratorOfListIO anIt (aList);
1314 for (; anIt.More(); anIt.Next()) {
1315 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1316 if (aRes && !aGroup->_is_nil()) {
1317 // check if mesh is the same
1318 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1319 SMESH::long_array_var anElements = aGroup->GetListOfID();
1320 int k = anElements->length();
1321 QListBoxItem* anItem = 0;
1322 for (int i = 0; i < k; i++) {
1323 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1324 if (anItem) delete anItem;
1335 //=================================================================================
1336 // function : onSort()
1338 //=================================================================================
1339 void SMESHGUI_GroupDlg::onSort()
1341 // PAL5412: sorts items in ascending by "string" value
1342 // myElements->sort(true);
1343 // myElements->update();
1344 int i, k = myElements->count();
1347 QStringList aSelected;
1348 std::vector<int> anArray(k);
1349 // QMemArray<int> anArray(k);
1350 QListBoxItem* anItem;
1352 for (anItem = myElements->firstItem(), i = 0; anItem != 0; anItem = anItem->next(), i++) {
1353 anArray[i] = anItem->text().toInt();
1354 if (anItem->isSelected())
1355 aSelected.append(anItem->text());
1357 // sort & update list
1358 std::sort(anArray.begin(), anArray.end());
1360 myElements->clear();
1361 for (i = 0; i < k; i++) {
1362 myElements->insertItem(QString::number(anArray[i]));
1364 for (QStringList::iterator it = aSelected.begin(); it != aSelected.end(); ++it) {
1365 anItem = myElements->findItem(*it, Qt::ExactMatch);
1366 if (anItem) myElements->setSelected(anItem, true);
1372 //=================================================================================
1373 // function : closeEvent()
1375 //=================================================================================
1376 void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*)
1381 //=================================================================================
1382 // function : SMESHGUI_GroupDlg::onClose
1383 // purpose : SLOT called when "Close" button pressed. Close dialog
1384 //=================================================================================
1385 void SMESHGUI_GroupDlg::onClose()
1387 if (SMESH::GetCurrentVtkView()) {
1388 SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
1389 SMESH::SetPointRepresentation(false);
1390 SMESH::SetPickable();
1393 mySelectionMgr->clearSelected();
1394 myViewWindow->SetSelectionMode(ActorSelection);
1395 mySelectionMgr->clearFilters();
1396 mySMESHGUI->ResetState();
1401 //=================================================================================
1402 // function : SMESHGUI_GroupDlg::onDeactivate
1403 // purpose : SLOT called when dialog must be deativated
1404 //=================================================================================
1405 void SMESHGUI_GroupDlg::onDeactivate()
1407 mySMESHGUI->ResetState();
1411 //=================================================================================
1412 // function : SMESHGUI_GroupDlg::enterEvent
1413 // purpose : Event filter
1414 //=================================================================================
1415 void SMESHGUI_GroupDlg::enterEvent (QEvent*)
1418 mySMESHGUI->EmitSignalDeactivateDialog();
1420 mySelectionMode = -1;
1421 setSelectionMode(myTypeId);
1422 //mySMESHGUI->SetActiveDialogBox((QDialog*)this);
1423 mySMESHGUI->SetActiveDialogBox(this);
1424 mySMESHGUI->SetState(800);
1428 //=================================================================================
1429 // function : hideEvent
1430 // purpose : caused by ESC key
1431 //=================================================================================
1432 void SMESHGUI_GroupDlg::hideEvent (QHideEvent*)