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() ),
97 if (!name) setName("SMESHGUI_GroupDlg");
99 if (!theMesh->_is_nil())
102 mySelectSubMesh->setEnabled(false);
103 mySelectGroup->setEnabled(false);
104 myGeomGroupBtn->setEnabled(false);
105 myGeomGroupLine->setEnabled(false);
108 /* Move widget on the botton right corner of main widget */
110 mySMESHGUI->DefineDlgPosition(this, x, y);
114 //=================================================================================
115 // function : SMESHGUI_GroupDlg()
117 //=================================================================================
118 SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
119 SMESH::SMESH_Group_ptr theGroup, bool modal, WFlags fl)
120 : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
121 WStyle_Title | WStyle_SysMenu | WDestructiveClose),
122 mySMESHGUI( theModule ),
123 mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
124 myViewWindow( SMESH::GetViewWindow( theModule ) ),
125 mySelector( myViewWindow->GetSelector() ),
128 if (!name) setName("SMESHGUI_GroupDlg");
130 if (!theGroup->_is_nil())
133 mySelectSubMesh->setEnabled(false);
134 mySelectGroup->setEnabled(false);
137 /* Move widget on the botton right corner of main widget */
139 mySMESHGUI->DefineDlgPosition(this, x, y);
143 //=================================================================================
144 // function : SMESHGUI_GroupDlg()
146 //=================================================================================
147 void SMESHGUI_GroupDlg::initDialog(bool create)
151 myCurrentLineEdit = 0;
153 QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
156 setCaption(tr("SMESH_CREATE_GROUP_TITLE"));
158 setCaption(tr("SMESH_EDIT_GROUP_TITLE"));
160 setSizeGripEnabled(TRUE);
162 QGridLayout* aMainLayout = new QGridLayout(this, 7, 3, 11, 6);
164 /***************************************************************/
165 QLabel* meshGroupLab = new QLabel(this, "mesh/group label");
167 meshGroupLab->setText(tr("SMESH_MESH"));
169 meshGroupLab->setText(tr("SMESH_GROUP"));
170 myMeshGroupBtn = new QPushButton(this, "mesh/group button");
171 myMeshGroupBtn->setPixmap(image0);
172 myMeshGroupLine = new QLineEdit(this, "mesh/group line");
173 myMeshGroupLine->setReadOnly(true);
175 /***************************************************************/
176 myTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Group types");
177 myTypeGroup->setTitle(tr("SMESH_ELEMENTS_TYPE"));
178 myTypeGroup->setExclusive(true);
181 types.append(tr("MESH_NODE"));
182 types.append(tr("SMESH_EDGE"));
183 types.append(tr("SMESH_FACE"));
184 types.append(tr("SMESH_VOLUME"));
186 for (int i = 0; i < types.count(); i++) {
187 rb = new QRadioButton(types[i], myTypeGroup);
189 myTypeGroup->setEnabled(create);
192 /***************************************************************/
193 QLabel* aName = new QLabel(this, "name label");
194 aName->setText(tr("SMESH_NAME"));
195 aName->setMinimumSize(50,0);
196 myName = new QLineEdit(this, "name");
198 /***************************************************************/
199 myGrpTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Type of group");
200 myGrpTypeGroup->setTitle(tr("SMESH_GROUP_TYPE"));
201 myGrpTypeGroup->setExclusive(true);
202 QRadioButton* rb1 = new QRadioButton( tr("SMESH_GROUP_STANDALONE"), myGrpTypeGroup);
203 QRadioButton* rb2 = new QRadioButton( tr("SMESH_GROUP_GEOMETRY"), myGrpTypeGroup);
204 myGrpTypeGroup->setEnabled(create);
207 /***************************************************************/
208 myWGStack = new QWidgetStack( this, "widget stack");
209 QWidget* wg1 = new QFrame( myWGStack, "first widget" );
210 QWidget* wg2 = new QFrame( myWGStack, "second widget" );
212 /***************************************************************/
213 QGroupBox* aContentBox = new QGroupBox(1, Qt::Horizontal, wg1, "content box");
214 aContentBox->setTitle(tr("SMESH_CONTENT"));
215 QFrame* aContent = new QFrame(aContentBox, "content");
216 QGridLayout* aLayout = new QGridLayout(aContent, 7, 4);
217 aLayout->setSpacing(6);
218 aLayout->setAutoAdd(false);
220 QLabel* aLabel = new QLabel(aContent, "elements label");
221 aLabel->setText(tr("SMESH_ID_ELEMENTS"));
222 myElements = new QListBox(aContent, "elements list");
223 myElements->setSelectionMode(QListBox::Extended);
225 myFilter = new QPushButton(aContent, "filter");
226 myFilter->setText(tr("SMESH_BUT_FILTER"));
227 QPushButton* aAddBtn = new QPushButton(aContent, "add");
228 aAddBtn->setText(tr("SMESH_BUT_ADD"));
229 QPushButton* aRemoveBtn = new QPushButton(aContent, "remove");
230 aRemoveBtn->setText(tr("SMESH_BUT_REMOVE"));
231 QPushButton* aSortBtn = new QPushButton(aContent, "sort");
232 aSortBtn->setText(tr("SMESH_BUT_SORT"));
234 aLayout->addWidget(aLabel, 0, 0);
235 aLayout->addMultiCellWidget(myElements, 1, 6, 0, 0);
236 aLayout->addWidget(myFilter, 1, 2);
237 aLayout->addWidget(aAddBtn, 3, 2);
238 aLayout->addWidget(aRemoveBtn, 4, 2);
239 aLayout->addWidget(aSortBtn, 6, 2);
241 aLayout->setColStretch(0, 1);
242 aLayout->addColSpacing(1, 20);
243 aLayout->addColSpacing(3, 20);
244 aLayout->setRowStretch(2, 1);
245 aLayout->setRowStretch(5, 1);
247 /***************************************************************/
248 QGroupBox* aSelectBox = new QGroupBox(3, Qt::Horizontal, wg1, "select box");
249 aSelectBox->setTitle(tr("SMESH_SELECT_FROM"));
251 mySelectSubMesh = new QCheckBox(aSelectBox, "submesh checkbox");
252 mySelectSubMesh->setText(tr("SMESH_SUBMESH"));
253 mySelectSubMesh->setMinimumSize(50, 0);
254 mySubMeshBtn = new QPushButton(aSelectBox, "submesh button");
255 mySubMeshBtn->setText("");
256 mySubMeshBtn->setPixmap(image0);
257 mySubMeshLine = new QLineEdit(aSelectBox, "submesh line");
258 mySubMeshLine->setReadOnly(true);
259 onSelectSubMesh(false);
261 mySelectGroup = new QCheckBox(aSelectBox, "group checkbox");
262 mySelectGroup->setText(tr("SMESH_GROUP"));
263 mySelectGroup->setMinimumSize(50, 0);
264 myGroupBtn = new QPushButton(aSelectBox, "group button");
265 myGroupBtn->setText("");
266 myGroupBtn->setPixmap(image0);
267 myGroupLine = new QLineEdit(aSelectBox, "group line");
268 myGroupLine->setReadOnly(true);
269 onSelectGroup(false);
271 /***************************************************************/
272 QGridLayout* wg1Layout = new QGridLayout( wg1, 3, 1, 0, 6 );
273 wg1Layout->addWidget(aContentBox, 0, 0);
274 wg1Layout->addWidget(aSelectBox, 1, 0);
275 wg1Layout->setRowStretch(2, 5);
277 /***************************************************************/
278 QLabel* geomObject = new QLabel(wg2, "geometry object label");
279 geomObject->setText(tr("SMESH_OBJECT_GEOM"));
280 myGeomGroupBtn = new QPushButton(wg2, "geometry group button");
281 myGeomGroupBtn->setText("");
282 myGeomGroupBtn->setPixmap(image0);
283 myGeomGroupLine = new QLineEdit(wg2, "geometry group line");
284 myGeomGroupLine->setReadOnly(true); //VSR ???
285 onSelectGeomGroup(false);
287 /***************************************************************/
288 QGridLayout* wg2Layout = new QGridLayout( wg2, 2, 3, 0, 6 );
289 wg2Layout->addWidget(geomObject, 0, 0);
290 wg2Layout->addWidget(myGeomGroupBtn, 0, 1);
291 wg2Layout->addWidget(myGeomGroupLine,0, 2);
292 wg2Layout->setRowStretch(1, 5);
294 /***************************************************************/
295 QVBoxLayout* dumb = new QVBoxLayout(myWGStack);
296 dumb->addWidget(wg1);
297 dumb->addWidget(wg2);
298 myWGStack->addWidget( wg1, myGrpTypeGroup->id(rb1) );
299 myWGStack->addWidget( wg2, myGrpTypeGroup->id(rb2) );
301 /***************************************************************/
302 QFrame* aButtons = new QFrame(this, "button box");
303 aButtons->setFrameStyle(QFrame::Box | QFrame::Sunken);
304 QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons, 11, 6);
305 aBtnLayout->setAutoAdd(false);
307 QPushButton* aOKBtn = new QPushButton(aButtons, "ok");
308 aOKBtn->setText(tr("SMESH_BUT_OK"));
309 aOKBtn->setAutoDefault(true);
310 aOKBtn->setDefault(true);
311 QPushButton* aApplyBtn = new QPushButton(aButtons, "apply");
312 aApplyBtn->setText(tr("SMESH_BUT_APPLY"));
313 aApplyBtn->setAutoDefault(true);
314 QPushButton* aCloseBtn = new QPushButton(aButtons, "close");
315 aCloseBtn->setText(tr("SMESH_BUT_CLOSE"));
316 aCloseBtn->setAutoDefault(true);
318 aBtnLayout->addWidget(aOKBtn);
319 aBtnLayout->addWidget(aApplyBtn);
320 aBtnLayout->addStretch();
321 aBtnLayout->addWidget(aCloseBtn);
323 /***************************************************************/
324 aMainLayout->addWidget(meshGroupLab, 0, 0);
325 aMainLayout->addWidget(myMeshGroupBtn, 0, 1);
326 aMainLayout->addWidget(myMeshGroupLine, 0, 2);
327 aMainLayout->addMultiCellWidget(myTypeGroup, 1, 1, 0, 2);
328 aMainLayout->addWidget(aName, 2, 0);
329 aMainLayout->addWidget(myName, 2, 2);
330 aMainLayout->addMultiCellWidget(myGrpTypeGroup, 3, 3, 0, 2);
331 aMainLayout->addMultiCellWidget(myWGStack, 4, 4, 0, 2);
332 aMainLayout->setRowStretch( 5, 5 );
333 aMainLayout->addMultiCellWidget(aButtons, 6, 6, 0, 2);
335 /* signals and slots connections */
336 connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
338 connect(myGrpTypeGroup, SIGNAL(clicked(int)), this, SLOT(onGrpTypeChanged(int)));
340 connect(myTypeGroup, SIGNAL(clicked(int)), this, SLOT(onTypeChanged(int)));
342 connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
343 connect(myElements, SIGNAL(selectionChanged()), this, SLOT(onListSelectionChanged()));
345 connect(myFilter, SIGNAL(clicked()), this, SLOT(setFilters()));
346 connect(aAddBtn, SIGNAL(clicked()), this, SLOT(onAdd()));
347 connect(aRemoveBtn, SIGNAL(clicked()), this, SLOT(onRemove()));
348 connect(aSortBtn, SIGNAL(clicked()), this, SLOT(onSort()));
350 connect(mySelectSubMesh, SIGNAL(toggled(bool)), this, SLOT(onSelectSubMesh(bool)));
351 connect(mySelectGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool)));
352 connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
353 connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
354 connect(myGeomGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
356 connect(aOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
357 connect(aApplyBtn, SIGNAL(clicked()), this, SLOT(onApply()));
358 connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(onClose()));
361 mySMESHGUI->SetActiveDialogBox(this);
362 mySMESHGUI->SetState(800);
364 mySelectionMode = -1;
365 myMeshFilter = new SMESH_TypeFilter(MESH);
366 mySubMeshFilter = new SMESH_TypeFilter(SUBMESH);
367 myGroupFilter = new SMESH_TypeFilter(GROUP);
369 connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
370 connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onClose()));
371 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged()));
373 myGrpTypeGroup->setButton(myGrpTypeGroup->id(rb1)); // VSR !!!
374 onGrpTypeChanged(myGrpTypeGroup->id(rb1)); // VSR!!!
376 if (myMesh->_is_nil() )
377 myTypeGroup->setButton(0);
382 //=================================================================================
383 // function : ~SMESHGUI_GroupDlg()
384 // purpose : Destroys the object and frees any allocated resources
385 //=================================================================================
386 SMESHGUI_GroupDlg::~SMESHGUI_GroupDlg()
388 // no need to delete child widgets, Qt does it all for us
389 if ( myFilterDlg != 0 )
391 myFilterDlg->reparent( 0, QPoint() );
396 //=================================================================================
399 //=================================================================================
400 void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
402 mySelectionMgr->installFilter(myMeshFilter);
404 /* init data from current selection */
405 myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
406 myGroup = SMESH::SMESH_Group::_nil();
408 myActor = SMESH::FindActorByObject(myMesh);
409 SMESH::SetPickable(myActor);
412 mySelectionMgr->selectedObjects( aList );
413 if( !aList.IsEmpty() )
415 QString aName = aList.First()->getName();
416 myMeshGroupLine->setText(aName) ;
417 myMeshGroupLine->home( false );
420 myCurrentLineEdit = 0;
422 myTypeGroup->setButton(0);
426 //=================================================================================
429 //=================================================================================
430 void SMESHGUI_GroupDlg::init (SMESH::SMESH_Group_ptr theGroup)
432 myMesh = theGroup->GetMesh();
433 myGroup = SMESH::SMESH_Group::_duplicate(theGroup);
435 myActor = SMESH::FindActorByObject(myMesh);
437 myActor = SMESH::FindActorByObject(myGroup);
438 SMESH::SetPickable(myActor);
441 switch(theGroup->GetType()) {
442 case SMESH::NODE: aType= 0; break;
443 case SMESH::EDGE: aType = 1; break;
444 case SMESH::FACE: aType = 2; break;
445 case SMESH::VOLUME: aType = 3; break;
448 myName->setText(myGroup->GetName());
450 myMeshGroupLine->setText(myGroup->GetName());
452 myCurrentLineEdit = 0;
453 myTypeGroup->setButton(aType);
455 setSelectionMode(aType);
459 if (!theGroup->IsEmpty()) {
460 SMESH::long_array_var anElements = myGroup->GetListOfID();
461 int k = anElements->length();
462 for (int i = 0; i < k; i++) {
463 myIdList.append(anElements[i]);
464 myElements->insertItem(QString::number(anElements[i]));
466 myElements->selectAll(true);
470 //=================================================================================
471 // function : updateButtons()
473 //=================================================================================
474 void SMESHGUI_GroupDlg::updateButtons()
478 if (myGrpTypeId == 0)
479 enable = !myName->text().stripWhiteSpace().isEmpty() && myElements->count() > 0;
480 else if (myGrpTypeId == 1)
481 enable = !myName->text().stripWhiteSpace().isEmpty() && !CORBA::is_nil( myGeomGroup );
483 aBtn = (QPushButton*) child("ok", "QPushButton");
484 if (aBtn) aBtn->setEnabled(enable);
485 aBtn = (QPushButton*) child("apply", "QPushButton");
486 if (aBtn) aBtn->setEnabled(enable);
489 //=================================================================================
490 // function : onNameChanged()
492 //=================================================================================
493 void SMESHGUI_GroupDlg::onNameChanged (const QString& text)
498 //=================================================================================
499 // function : onTypeChanged()
500 // purpose : Group elements type radio button management
501 //=================================================================================
502 void SMESHGUI_GroupDlg::onTypeChanged (int id)
504 if (myTypeId != id) {
506 if (myCurrentLineEdit == 0)
507 setSelectionMode(id);
512 //=================================================================================
513 // function : onGrpTypeChanged()
514 // purpose : Group type radio button management
515 //=================================================================================
516 void SMESHGUI_GroupDlg::onGrpTypeChanged (int id)
518 if (myGrpTypeId != id) {
519 myWGStack->raiseWidget( id );
520 onSelectGeomGroup(id == 1);
525 //=================================================================================
526 // function : setSelectionMode()
527 // purpose : Radio button management
528 //=================================================================================
529 void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
532 if (myMesh->_is_nil())
535 if (mySelectionMode != theMode) {
536 mySelectionMgr->clearSelected();
537 mySelectionMgr->clearFilters();
538 SMESH::SetPointRepresentation(false);
543 myActor->SetPointRepresentation(true);
545 SMESH::SetPointRepresentation(true);
546 myViewWindow->SetSelectionMode(NodeSelection);
549 myViewWindow->SetSelectionMode(EdgeSelection);
552 myViewWindow->SetSelectionMode(FaceSelection);
555 myViewWindow->SetSelectionMode(VolumeSelection);
558 myViewWindow->SetSelectionMode(ActorSelection);
560 mySelectionMgr->installFilter(mySubMeshFilter);
561 else if (theMode == 5)
562 mySelectionMgr->installFilter(myGroupFilter);
563 else if (theMode == 6)
564 mySelectionMgr->installFilter(myMeshFilter);
566 mySelectionMode = theMode;
570 //=================================================================================
571 // function : onApply()
573 //=================================================================================
574 bool SMESHGUI_GroupDlg::onApply()
576 if (mySMESHGUI->isActiveStudyLocked())
579 if (myGrpTypeId == 0 &&
580 !myName->text().stripWhiteSpace().isEmpty() &&
581 myElements->count() > 0) {
582 mySelectionMgr->clearSelected();
583 if (myGroup->_is_nil()) {
584 SMESH::ElementType aType = SMESH::ALL;
586 case 0: aType = SMESH::NODE; break;
587 case 1: aType = SMESH::EDGE; break;
588 case 2: aType = SMESH::FACE; break;
589 case 3: aType = SMESH::VOLUME; break;
591 SMESH::long_array_var anIdList = new SMESH::long_array;
592 int i, k = myElements->count();
594 QListBoxItem* anItem;
595 for (i = 0, anItem = myElements->firstItem(); anItem != 0; i++, anItem = anItem->next()) {
596 anIdList[i] = anItem->text().toInt();
599 myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
600 myGroup->Add(anIdList.inout());
602 /* init for next operation */
605 myGroup = SMESH::SMESH_Group::_nil();
608 myGroup->SetName(myName->text());
610 QValueList<int> aAddList;
611 QValueList<int>::iterator anIt;
612 QListBoxItem* anItem;
614 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
615 int anId = anItem->text().toInt();
616 if ((anIt = myIdList.find(anId)) == myIdList.end())
617 aAddList.append(anId);
619 myIdList.remove(anIt);
621 if (!aAddList.empty()) {
622 SMESH::long_array_var anIdList = new SMESH::long_array;
623 anIdList->length(aAddList.count());
625 for (i = 0, anIt = aAddList.begin(); anIt != aAddList.end(); anIt++, i++)
627 myGroup->Add(anIdList.inout());
629 if (!myIdList.empty()) {
630 SMESH::long_array_var anIdList = new SMESH::long_array;
631 anIdList->length(myIdList.count());
633 for (i = 0, anIt = myIdList.begin(); anIt != myIdList.end(); anIt++, i++)
635 myGroup->Remove(anIdList.inout());
637 /* init for next operation */
639 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next())
640 myIdList.append(anItem->text().toInt());
643 mySMESHGUI->updateObjBrowser(true);
644 SMESH::UpdateView(); // asv: fix of BUG PAL5515
645 mySelectionMgr->clearSelected();
647 } else if (myGrpTypeId == 1 &&
648 !myName->text().stripWhiteSpace().isEmpty() &&
649 !CORBA::is_nil(myGeomGroup))
651 SMESH::ElementType aType = SMESH::ALL;
653 case 0: aType = SMESH::NODE; break;
654 case 1: aType = SMESH::EDGE; break;
655 case 2: aType = SMESH::FACE; break;
656 case 3: aType = SMESH::VOLUME; break;
659 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
660 GEOM::GEOM_IGroupOperations_var aGroupOp =
661 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
663 SMESH::SMESH_GroupOnGeom_var aGroupOnGeom =
664 myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomGroup);
666 mySMESHGUI->updateObjBrowser(true);
667 mySelectionMgr->clearSelected();
668 /* init for next operation */
676 //=================================================================================
679 //=================================================================================
680 void SMESHGUI_GroupDlg::onOK()
686 //=================================================================================
687 // function : onListSelectionChanged()
688 // purpose : Called when selection in element list is changed
689 //=================================================================================
690 void SMESHGUI_GroupDlg::onListSelectionChanged()
692 // MESSAGE("SMESHGUI_GroupDlg::onListSelectionChanged(); myActor = " << myActor);
693 if( myIsBusy || !myActor) return;
696 if (myCurrentLineEdit == 0) {
697 mySelectionMgr->clearSelected();
698 TColStd_MapOfInteger aIndexes;
699 QListBoxItem* anItem;
700 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
701 if (anItem->isSelected()) {
702 int anId = anItem->text().toInt();
706 mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
708 aList.Append(myActor->getIO());
709 mySelectionMgr->setSelectedObjects(aList,false);
710 myViewWindow->highlight( myActor->getIO(), true, true );
715 //=================================================================================
716 // function : onObjectSelectionChanged()
717 // purpose : Called when selection in 3D view or ObjectBrowser is changed
718 //=================================================================================
719 void SMESHGUI_GroupDlg::onObjectSelectionChanged()
721 if ( myIsBusy || !isEnabled()) return;
725 mySelectionMgr->selectedObjects( aList );
727 int aNbSel = aList.Extent();
728 myElements->clearSelection();
730 if (myCurrentLineEdit) {
731 myCurrentLineEdit->setText("");
732 QString aString = "";
734 if (myCurrentLineEdit == myMeshGroupLine) {
735 mySelectSubMesh->setEnabled(false);
736 mySelectGroup->setEnabled(false);
737 myGroupLine->setText("");
738 mySubMeshLine->setText("");
740 myGeomGroupBtn->setEnabled(false);
741 myGeomGroupLine->setEnabled(false);
742 myGeomGroupLine->setText("");
749 myGroup = SMESH::SMESH_Group::_nil();
750 myMesh = SMESH::SMESH_Mesh::_nil();
754 Handle(SALOME_InteractiveObject) IO = aList.First();
757 myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
758 if (myMesh->_is_nil())
763 myGroup = SMESH::SMESH_Group::_nil();
765 myActor = SMESH::FindActorByObject(myMesh);
766 SMESH::SetPickable(myActor);
768 aString = aList.First()->getName();
769 myMeshGroupLine->setText(aString) ;
770 myMeshGroupLine->home( false );
772 mySelectSubMesh->setEnabled(true);
773 mySelectGroup->setEnabled(true);
774 myGeomGroupBtn->setEnabled(true);
775 myGeomGroupLine->setEnabled(true);
778 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(IO);
779 if (aGroup->_is_nil())
785 myCurrentLineEdit = 0;
788 mySelectSubMesh->setEnabled(true);
789 mySelectGroup->setEnabled(true);
790 myGeomGroupBtn->setEnabled(true);
791 myGeomGroupLine->setEnabled(true);
793 myCurrentLineEdit = 0;
802 setSelectionMode(myTypeId);
808 } else if (myCurrentLineEdit == myGeomGroupLine) {
810 myGeomGroup = GEOM::GEOM_Object::_nil();
815 Standard_Boolean testResult = Standard_False;
816 myGeomGroup = GEOMBase::ConvertIOinGEOMObject(aList.First(), testResult);
818 // Check if the object is a geometry group
819 if (!testResult || CORBA::is_nil(myGeomGroup)) {
820 myGeomGroup = GEOM::GEOM_Object::_nil();
824 // Check if group constructed on the same shape as a mesh or on its child
825 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
826 GEOM::GEOM_IGroupOperations_var anOp =
827 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
829 // The main shape of the group
830 GEOM::GEOM_Object_var aGroupMainShape;
831 if (myGeomGroup->GetType() == 37)
832 aGroupMainShape = anOp->GetMainShape(myGeomGroup);
834 aGroupMainShape = GEOM::GEOM_Object::_duplicate(myGeomGroup);
835 _PTR(SObject) aGroupMainShapeSO =
836 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
837 aStudy->FindObjectIOR(aGroupMainShape->GetStudyEntry());
840 _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
842 myGeomGroup = GEOM::GEOM_Object::_nil();
846 _PTR(SObject) anObj, aRef;
847 bool isRefOrSubShape = false;
848 if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) {
849 //if (strcmp(aRef->GetID(), aGroupMainShapeSO->GetID()) == 0) {
850 if (aRef->GetID() == aGroupMainShapeSO->GetID()) {
851 isRefOrSubShape = true;
853 _PTR(SObject) aFather = aGroupMainShapeSO->GetFather();
854 _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent();
855 //while (!isRefOrSubShape && strcmp(aFather->GetID(), aComponent->GetID()) != 0) {
856 while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) {
857 //if (strcmp(aRef->GetID(), aFather->GetID()) == 0)
858 if (aRef->GetID() == aFather->GetID())
859 isRefOrSubShape = true;
861 aFather = aFather->GetFather();
865 if (!isRefOrSubShape) {
866 myGeomGroup = GEOM::GEOM_Object::_nil();
874 if(myCurrentLineEdit == mySubMeshLine)
875 aString = tr("SMESH_SUBMESH_SELECTED").arg(aNbSel);
876 else if(myCurrentLineEdit == myGroupLine || myCurrentLineEdit == myGeomGroupLine)
877 aString = tr("SMESH_GROUP_SELECTED").arg(aNbSel);
879 aString = aList.First()->getName();
883 myCurrentLineEdit->setText(aString);
884 myCurrentLineEdit->home(false);
889 if (aNbSel == 1 && myActor ) {
890 QString aListStr = "";
893 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
895 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
898 QStringList anElements = QStringList::split(" ", aListStr);
899 QListBoxItem* anItem = 0;
900 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
901 anItem = myElements->findItem(*it, Qt::ExactMatch);
902 if (anItem) myElements->setSelected(anItem, true);
909 if (!myGroup->_is_nil())
910 myActor = SMESH::FindActorByObject(myGroup);
912 myActor = SMESH::FindActorByObject(myMesh);
918 //=================================================================================
919 // function : onSelectSubMesh()
920 // purpose : Called when selection in 3D view or ObjectBrowser is changed
921 //=================================================================================
922 void SMESHGUI_GroupDlg::onSelectSubMesh(bool on)
925 if (mySelectGroup->isChecked()) {
926 mySelectGroup->setChecked(false);
928 //VSR: else if (mySelectGeomGroup->isChecked()) {
929 //VSR: mySelectGeomGroup->setChecked(false);
931 myCurrentLineEdit = mySubMeshLine;
935 mySubMeshLine->setText("");
936 myCurrentLineEdit = 0;
938 setSelectionMode(myTypeId);
940 mySubMeshBtn->setEnabled(on);
941 mySubMeshLine->setEnabled(on);
945 //=================================================================================
946 // function : (onSelectGroup)
947 // purpose : Called when selection in 3D view or ObjectBrowser is changed
948 //=================================================================================
949 void SMESHGUI_GroupDlg::onSelectGroup(bool on)
952 if (mySelectSubMesh->isChecked()) {
953 mySelectSubMesh->setChecked(false);
955 myCurrentLineEdit = myGroupLine;
959 myGroupLine->setText("");
960 myCurrentLineEdit = 0;
962 setSelectionMode(myTypeId);
964 myGroupBtn->setEnabled(on);
965 myGroupLine->setEnabled(on);
969 //=================================================================================
970 // function : (onSelectGeomGroup)
971 // purpose : Called when selection in 3D view or ObjectBrowser is changed
972 //=================================================================================
973 void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
976 if (mySelectSubMesh->isChecked()) {
977 mySelectSubMesh->setChecked(false);
979 else if (mySelectGroup->isChecked()) {
980 mySelectGroup->setChecked(false);
982 myCurrentLineEdit = myGeomGroupLine;
986 myGeomGroupLine->setText("");
987 myCurrentLineEdit = 0;
989 setSelectionMode(myTypeId);
994 //=================================================================================
995 // function : setCurrentSelection()
997 //=================================================================================
998 void SMESHGUI_GroupDlg::setCurrentSelection()
1000 QPushButton* send = (QPushButton*)sender();
1001 myCurrentLineEdit = 0;
1002 if (send == myMeshGroupBtn) {
1003 myCurrentLineEdit = myMeshGroupLine;
1005 setSelectionMode(6);
1007 setSelectionMode(5);
1008 onObjectSelectionChanged();
1010 else if (send == mySubMeshBtn) {
1011 myCurrentLineEdit = mySubMeshLine;
1012 onObjectSelectionChanged();
1014 else if (send == myGroupBtn) {
1015 myCurrentLineEdit = myGroupLine;
1016 onObjectSelectionChanged();
1018 else if (send == myGeomGroupBtn) {
1019 myCurrentLineEdit = myGeomGroupLine;
1020 setSelectionMode(7);
1021 onObjectSelectionChanged();
1026 //=================================================================================
1027 // function : setFilters()
1028 // purpose : SLOT. Called when "Filter" button pressed.
1029 //=================================================================================
1030 void SMESHGUI_GroupDlg::setFilters()
1032 SMESH::ElementType aType = SMESH::ALL;
1035 case 0 : aType = SMESH::NODE; break;
1036 case 1 : aType = SMESH::EDGE; break;
1037 case 2 : aType = SMESH::FACE; break;
1038 case 3 : aType = SMESH::VOLUME; break;
1042 if ( myFilterDlg == 0 )
1044 myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, aType );
1045 connect( myFilterDlg, SIGNAL( Accepted() ), SLOT( onFilterAccepted() ) );
1048 myFilterDlg->Init( aType );
1050 myFilterDlg->SetSelection();
1051 myFilterDlg->SetMesh( myMesh );
1052 myFilterDlg->SetSourceWg( myElements );
1054 myFilterDlg->show();
1057 //=================================================================================
1058 // function : onFilterAccepted()
1059 // purpose : SLOT. Called when Filter dlg closed with OK button.
1060 // Uncheck "Select submesh" and "Select group" checkboxes
1061 //=================================================================================
1062 void SMESHGUI_GroupDlg::onFilterAccepted()
1064 if ( mySelectSubMesh->isChecked() || mySelectGroup->isChecked() )
1066 mySelectionMode = myTypeId;
1067 mySelectSubMesh->setChecked( false );
1068 mySelectGroup->setChecked( false );
1072 //=================================================================================
1073 // function : onAdd()
1075 //=================================================================================
1076 void SMESHGUI_GroupDlg::onAdd()
1078 SALOME_ListIO aList;
1079 mySelectionMgr->selectedObjects( aList );
1081 int aNbSel = aList.Extent();
1083 if (aNbSel == 0 || !myActor || myMesh->_is_nil()) return;
1087 SMESH::ElementType aType = SMESH::ALL;
1089 case 0: aType = SMESH::NODE; break;
1090 case 1: aType = SMESH::EDGE; break;
1091 case 2: aType = SMESH::FACE; break;
1092 case 3: aType = SMESH::VOLUME; break;
1095 if (myCurrentLineEdit == 0) {
1096 //if (aNbSel != 1) { myIsBusy = false; return; }
1097 QString aListStr = "";
1099 if (myTypeId == 0) {
1100 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
1103 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
1106 QStringList anElements = QStringList::split(" ", aListStr);
1107 QListBoxItem* anItem = 0;
1108 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
1109 anItem = myElements->findItem(*it, Qt::ExactMatch);
1111 anItem = new QListBoxText(*it);
1112 myElements->insertItem(anItem);
1114 myElements->setSelected(anItem, true);
1117 } else if (myCurrentLineEdit == mySubMeshLine) {
1118 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1120 SALOME_ListIO aList;
1121 mySelectionMgr->selectedObjects( aList );
1123 SALOME_ListIteratorOfListIO anIt (aList);
1124 for (; anIt.More(); anIt.Next()) {
1125 SMESH::SMESH_subMesh_var aSubMesh =
1126 SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1127 if (!aSubMesh->_is_nil()) {
1128 // check if mesh is the same
1129 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1131 SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
1132 int k = anElements->length();
1133 QListBoxItem* anItem = 0;
1134 for (int i = 0; i < k; i++) {
1135 QString aText = QString::number(anElements[i]);
1136 anItem = myElements->findItem(aText, Qt::ExactMatch);
1138 anItem = new QListBoxText(aText);
1139 myElements->insertItem(anItem);
1141 myElements->setSelected(anItem, true);
1144 catch (const SALOME::SALOME_Exception& ex) {
1145 SalomeApp_Tools::QtCatchCorbaException(ex);
1150 mySelectSubMesh->setChecked(false);
1152 onListSelectionChanged();
1154 } else if (myCurrentLineEdit == myGroupLine) {
1155 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1156 SALOME_ListIO aList;
1157 mySelectionMgr->selectedObjects( aList );
1159 SALOME_ListIteratorOfListIO anIt (aList);
1160 for (; anIt.More(); anIt.Next()) {
1161 SMESH::SMESH_Group_var aGroup =
1162 SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1163 if (!aGroup->_is_nil()) {
1164 // check if mesh is the same
1165 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1166 SMESH::long_array_var anElements = aGroup->GetListOfID();
1167 int k = anElements->length();
1168 QListBoxItem* anItem = 0;
1169 for (int i = 0; i < k; i++) {
1170 QString aText = QString::number(anElements[i]);
1171 anItem = myElements->findItem(aText, Qt::ExactMatch);
1173 anItem = new QListBoxText(aText);
1174 myElements->insertItem(anItem);
1176 myElements->setSelected(anItem, true);
1181 mySelectGroup->setChecked(false);
1183 onListSelectionChanged();
1185 } else if (myCurrentLineEdit == myGeomGroupLine && !CORBA::is_nil(myGeomGroup)) {
1186 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
1187 GEOM::GEOM_IGroupOperations_var aGroupOp =
1188 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
1190 SMESH::ElementType aGroupType = SMESH::ALL;
1191 switch(aGroupOp->GetType(myGeomGroup)) {
1192 case 7: aGroupType = SMESH::NODE; break;
1193 case 6: aGroupType = SMESH::EDGE; break;
1194 case 4: aGroupType = SMESH::FACE; break;
1195 case 2: aGroupType = SMESH::VOLUME; break;
1196 default: myIsBusy = false; return;
1199 if (aGroupType == aType) {
1200 _PTR(SObject) aGroupSO =
1201 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
1202 aStudy->FindObjectIOR(myGeomGroup->GetStudyEntry());
1204 SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
1205 SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
1206 SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom();;
1207 aBelongToGeom->SetGeom(myGeomGroup);
1208 aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str());
1209 aBelongToGeom->SetElementType(aType);
1210 aFilter->SetPredicate(aBelongToGeom);
1212 SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh);
1214 int k = anElements->length();
1215 QListBoxItem* anItem = 0;
1216 for (int i = 0; i < k; i++) {
1217 QString aText = QString::number(anElements[i]);
1218 anItem = myElements->findItem(aText, Qt::ExactMatch);
1220 anItem = new QListBoxText(aText);
1221 myElements->insertItem(anItem);
1223 myElements->setSelected(anItem, true);
1227 //VSR: mySelectGeomGroup->setChecked(false);
1229 onListSelectionChanged();
1232 // mySelectionMgr->clearSelected();
1236 //=================================================================================
1237 // function : onRemove()
1239 //=================================================================================
1240 void SMESHGUI_GroupDlg::onRemove()
1243 if (myCurrentLineEdit == 0) {
1244 for (int i = myElements->count(); i > 0; i--) {
1245 if (myElements->isSelected(i-1)) {
1246 myElements->removeItem(i-1);
1250 SALOME_ListIO aList;
1251 mySelectionMgr->selectedObjects( aList );
1253 int aNbSel = aList.Extent();
1255 if (aNbSel == 0) { myIsBusy = false; return; }
1257 SMESH::ElementType aType = SMESH::ALL;
1259 case 0: aType = SMESH::NODE; break;
1260 case 1: aType = SMESH::EDGE; break;
1261 case 2: aType = SMESH::FACE; break;
1262 case 3: aType = SMESH::VOLUME; break;
1265 if (myCurrentLineEdit == mySubMeshLine) {
1266 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1267 SALOME_ListIO aList;
1268 mySelectionMgr->selectedObjects( aList );
1270 SALOME_ListIteratorOfListIO anIt (aList);
1271 for (; anIt.More(); anIt.Next()) {
1272 SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1273 if (!aSubMesh->_is_nil()) {
1274 // check if mesh is the same
1275 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1276 if (aType == SMESH::NODE) {
1278 SMESH::long_array_var anElements = aSubMesh->GetNodesId();
1279 int k = anElements->length();
1280 QListBoxItem* anItem = 0;
1281 for (int i = 0; i < k; i++) {
1282 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1283 if (anItem) delete anItem;
1286 catch (const SALOME::SALOME_Exception& ex) {
1287 SalomeApp_Tools::QtCatchCorbaException(ex);
1292 SMESH::long_array_var anElements = aSubMesh->GetElementsId();
1293 int k = anElements->length();
1294 QListBoxItem* anItem = 0;
1295 for (int i = 0; i < k; i++) {
1296 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1297 if (anItem) delete anItem;
1300 catch (const SALOME::SALOME_Exception& ex) {
1301 SalomeApp_Tools::QtCatchCorbaException(ex);
1308 else if (myCurrentLineEdit == myGroupLine) {
1309 Standard_Boolean aRes;
1310 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1311 SALOME_ListIO aList;
1312 mySelectionMgr->selectedObjects( aList );
1314 SALOME_ListIteratorOfListIO anIt (aList);
1315 for (; anIt.More(); anIt.Next()) {
1316 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1317 if (aRes && !aGroup->_is_nil()) {
1318 // check if mesh is the same
1319 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1320 SMESH::long_array_var anElements = aGroup->GetListOfID();
1321 int k = anElements->length();
1322 QListBoxItem* anItem = 0;
1323 for (int i = 0; i < k; i++) {
1324 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1325 if (anItem) delete anItem;
1336 //=================================================================================
1337 // function : onSort()
1339 //=================================================================================
1340 void SMESHGUI_GroupDlg::onSort()
1342 // PAL5412: sorts items in ascending by "string" value
1343 // myElements->sort(true);
1344 // myElements->update();
1345 int i, k = myElements->count();
1348 QStringList aSelected;
1349 std::vector<int> anArray(k);
1350 // QMemArray<int> anArray(k);
1351 QListBoxItem* anItem;
1353 for (anItem = myElements->firstItem(), i = 0; anItem != 0; anItem = anItem->next(), i++) {
1354 anArray[i] = anItem->text().toInt();
1355 if (anItem->isSelected())
1356 aSelected.append(anItem->text());
1358 // sort & update list
1359 std::sort(anArray.begin(), anArray.end());
1361 myElements->clear();
1362 for (i = 0; i < k; i++) {
1363 myElements->insertItem(QString::number(anArray[i]));
1365 for (QStringList::iterator it = aSelected.begin(); it != aSelected.end(); ++it) {
1366 anItem = myElements->findItem(*it, Qt::ExactMatch);
1367 if (anItem) myElements->setSelected(anItem, true);
1373 //=================================================================================
1374 // function : closeEvent()
1376 //=================================================================================
1377 void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*)
1382 //=================================================================================
1383 // function : SMESHGUI_GroupDlg::onClose
1384 // purpose : SLOT called when "Close" button pressed. Close dialog
1385 //=================================================================================
1386 void SMESHGUI_GroupDlg::onClose()
1388 if (SMESH::GetCurrentVtkView()) {
1389 SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
1390 SMESH::SetPointRepresentation(false);
1391 SMESH::SetPickable();
1394 mySelectionMgr->clearSelected();
1395 myViewWindow->SetSelectionMode(ActorSelection);
1396 mySelectionMgr->clearFilters();
1397 mySMESHGUI->ResetState();
1402 //=================================================================================
1403 // function : SMESHGUI_GroupDlg::onDeactivate
1404 // purpose : SLOT called when dialog must be deativated
1405 //=================================================================================
1406 void SMESHGUI_GroupDlg::onDeactivate()
1408 mySMESHGUI->ResetState();
1412 //=================================================================================
1413 // function : SMESHGUI_GroupDlg::enterEvent
1414 // purpose : Event filter
1415 //=================================================================================
1416 void SMESHGUI_GroupDlg::enterEvent (QEvent*)
1419 mySMESHGUI->EmitSignalDeactivateDialog();
1421 mySelectionMode = -1;
1422 setSelectionMode(myTypeId);
1423 //mySMESHGUI->SetActiveDialogBox((QDialog*)this);
1424 mySMESHGUI->SetActiveDialogBox(this);
1425 mySMESHGUI->SetState(800);
1429 //=================================================================================
1430 // function : hideEvent
1431 // purpose : caused by ESC key
1432 //=================================================================================
1433 void SMESHGUI_GroupDlg::hideEvent (QHideEvent*)