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() )
95 if (!name) setName("SMESHGUI_GroupDlg");
97 if (!theMesh->_is_nil())
100 mySelectSubMesh->setEnabled(false);
101 mySelectGroup->setEnabled(false);
102 myGeomGroupBtn->setEnabled(false);
103 myGeomGroupLine->setEnabled(false);
106 /* Move widget on the botton right corner of main widget */
108 mySMESHGUI->DefineDlgPosition(this, x, y);
112 //=================================================================================
113 // function : SMESHGUI_GroupDlg()
115 //=================================================================================
116 SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
117 SMESH::SMESH_Group_ptr theGroup, bool modal, WFlags fl)
118 : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
119 WStyle_Title | WStyle_SysMenu | WDestructiveClose),
120 mySMESHGUI( theModule ),
121 mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
122 myViewWindow( SMESH::GetViewWindow( theModule ) ),
123 mySelector( myViewWindow->GetSelector() )
125 if (!name) setName("SMESHGUI_GroupDlg");
127 if (!theGroup->_is_nil())
130 mySelectSubMesh->setEnabled(false);
131 mySelectGroup->setEnabled(false);
134 /* Move widget on the botton right corner of main widget */
136 mySMESHGUI->DefineDlgPosition(this, x, y);
140 //=================================================================================
141 // function : SMESHGUI_GroupDlg()
143 //=================================================================================
144 void SMESHGUI_GroupDlg::initDialog(bool create)
148 myCurrentLineEdit = 0;
150 QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
153 setCaption(tr("SMESH_CREATE_GROUP_TITLE"));
155 setCaption(tr("SMESH_EDIT_GROUP_TITLE"));
157 setSizeGripEnabled(TRUE);
159 QGridLayout* aMainLayout = new QGridLayout(this, 7, 3, 11, 6);
161 /***************************************************************/
162 QLabel* meshGroupLab = new QLabel(this, "mesh/group label");
164 meshGroupLab->setText(tr("SMESH_MESH"));
166 meshGroupLab->setText(tr("SMESH_GROUP"));
167 myMeshGroupBtn = new QPushButton(this, "mesh/group button");
168 myMeshGroupBtn->setPixmap(image0);
169 myMeshGroupLine = new QLineEdit(this, "mesh/group line");
170 myMeshGroupLine->setReadOnly(true);
172 /***************************************************************/
173 myTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Group types");
174 myTypeGroup->setTitle(tr("SMESH_ELEMENTS_TYPE"));
175 myTypeGroup->setExclusive(true);
178 types.append(tr("MESH_NODE"));
179 types.append(tr("SMESH_EDGE"));
180 types.append(tr("SMESH_FACE"));
181 types.append(tr("SMESH_VOLUME"));
183 for (int i = 0; i < types.count(); i++) {
184 rb = new QRadioButton(types[i], myTypeGroup);
186 myTypeGroup->setEnabled(create);
189 /***************************************************************/
190 QLabel* aName = new QLabel(this, "name label");
191 aName->setText(tr("SMESH_NAME"));
192 aName->setMinimumSize(50,0);
193 myName = new QLineEdit(this, "name");
195 /***************************************************************/
196 myGrpTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Type of group");
197 myGrpTypeGroup->setTitle(tr("SMESH_GROUP_TYPE"));
198 myGrpTypeGroup->setExclusive(true);
199 QRadioButton* rb1 = new QRadioButton( tr("SMESH_GROUP_STANDALONE"), myGrpTypeGroup);
200 QRadioButton* rb2 = new QRadioButton( tr("SMESH_GROUP_GEOMETRY"), myGrpTypeGroup);
201 myGrpTypeGroup->setEnabled(create);
204 /***************************************************************/
205 myWGStack = new QWidgetStack( this, "widget stack");
206 QWidget* wg1 = new QFrame( myWGStack, "first widget" );
207 QWidget* wg2 = new QFrame( myWGStack, "second widget" );
209 /***************************************************************/
210 QGroupBox* aContentBox = new QGroupBox(1, Qt::Horizontal, wg1, "content box");
211 aContentBox->setTitle(tr("SMESH_CONTENT"));
212 QFrame* aContent = new QFrame(aContentBox, "content");
213 QGridLayout* aLayout = new QGridLayout(aContent, 7, 4);
214 aLayout->setSpacing(6);
215 aLayout->setAutoAdd(false);
217 QLabel* aLabel = new QLabel(aContent, "elements label");
218 aLabel->setText(tr("SMESH_ID_ELEMENTS"));
219 myElements = new QListBox(aContent, "elements list");
220 myElements->setSelectionMode(QListBox::Extended);
222 myFilter = new QPushButton(aContent, "filter");
223 myFilter->setText(tr("SMESH_BUT_FILTER"));
224 QPushButton* aAddBtn = new QPushButton(aContent, "add");
225 aAddBtn->setText(tr("SMESH_BUT_ADD"));
226 QPushButton* aRemoveBtn = new QPushButton(aContent, "remove");
227 aRemoveBtn->setText(tr("SMESH_BUT_REMOVE"));
228 QPushButton* aSortBtn = new QPushButton(aContent, "sort");
229 aSortBtn->setText(tr("SMESH_BUT_SORT"));
231 aLayout->addWidget(aLabel, 0, 0);
232 aLayout->addMultiCellWidget(myElements, 1, 6, 0, 0);
233 aLayout->addWidget(myFilter, 1, 2);
234 aLayout->addWidget(aAddBtn, 3, 2);
235 aLayout->addWidget(aRemoveBtn, 4, 2);
236 aLayout->addWidget(aSortBtn, 6, 2);
238 aLayout->setColStretch(0, 1);
239 aLayout->addColSpacing(1, 20);
240 aLayout->addColSpacing(3, 20);
241 aLayout->setRowStretch(2, 1);
242 aLayout->setRowStretch(5, 1);
244 /***************************************************************/
245 QGroupBox* aSelectBox = new QGroupBox(3, Qt::Horizontal, wg1, "select box");
246 aSelectBox->setTitle(tr("SMESH_SELECT_FROM"));
248 mySelectSubMesh = new QCheckBox(aSelectBox, "submesh checkbox");
249 mySelectSubMesh->setText(tr("SMESH_SUBMESH"));
250 mySelectSubMesh->setMinimumSize(50, 0);
251 mySubMeshBtn = new QPushButton(aSelectBox, "submesh button");
252 mySubMeshBtn->setText("");
253 mySubMeshBtn->setPixmap(image0);
254 mySubMeshLine = new QLineEdit(aSelectBox, "submesh line");
255 mySubMeshLine->setReadOnly(true);
256 onSelectSubMesh(false);
258 mySelectGroup = new QCheckBox(aSelectBox, "group checkbox");
259 mySelectGroup->setText(tr("SMESH_GROUP"));
260 mySelectGroup->setMinimumSize(50, 0);
261 myGroupBtn = new QPushButton(aSelectBox, "group button");
262 myGroupBtn->setText("");
263 myGroupBtn->setPixmap(image0);
264 myGroupLine = new QLineEdit(aSelectBox, "group line");
265 myGroupLine->setReadOnly(true);
266 onSelectGroup(false);
268 /***************************************************************/
269 QGridLayout* wg1Layout = new QGridLayout( wg1, 3, 1, 0, 6 );
270 wg1Layout->addWidget(aContentBox, 0, 0);
271 wg1Layout->addWidget(aSelectBox, 1, 0);
272 wg1Layout->setRowStretch(2, 5);
274 /***************************************************************/
275 QLabel* geomObject = new QLabel(wg2, "geometry object label");
276 geomObject->setText(tr("SMESH_OBJECT_GEOM"));
277 myGeomGroupBtn = new QPushButton(wg2, "geometry group button");
278 myGeomGroupBtn->setText("");
279 myGeomGroupBtn->setPixmap(image0);
280 myGeomGroupLine = new QLineEdit(wg2, "geometry group line");
281 myGeomGroupLine->setReadOnly(true); //VSR ???
282 onSelectGeomGroup(false);
284 /***************************************************************/
285 QGridLayout* wg2Layout = new QGridLayout( wg2, 2, 3, 0, 6 );
286 wg2Layout->addWidget(geomObject, 0, 0);
287 wg2Layout->addWidget(myGeomGroupBtn, 0, 1);
288 wg2Layout->addWidget(myGeomGroupLine,0, 2);
289 wg2Layout->setRowStretch(1, 5);
291 /***************************************************************/
292 QVBoxLayout* dumb = new QVBoxLayout(myWGStack);
293 dumb->addWidget(wg1);
294 dumb->addWidget(wg2);
295 myWGStack->addWidget( wg1, myGrpTypeGroup->id(rb1) );
296 myWGStack->addWidget( wg2, myGrpTypeGroup->id(rb2) );
298 /***************************************************************/
299 QFrame* aButtons = new QFrame(this, "button box");
300 aButtons->setFrameStyle(QFrame::Box | QFrame::Sunken);
301 QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons, 11, 6);
302 aBtnLayout->setAutoAdd(false);
304 QPushButton* aOKBtn = new QPushButton(aButtons, "ok");
305 aOKBtn->setText(tr("SMESH_BUT_OK"));
306 aOKBtn->setAutoDefault(true);
307 aOKBtn->setDefault(true);
308 QPushButton* aApplyBtn = new QPushButton(aButtons, "apply");
309 aApplyBtn->setText(tr("SMESH_BUT_APPLY"));
310 aApplyBtn->setAutoDefault(true);
311 QPushButton* aCloseBtn = new QPushButton(aButtons, "close");
312 aCloseBtn->setText(tr("SMESH_BUT_CLOSE"));
313 aCloseBtn->setAutoDefault(true);
315 aBtnLayout->addWidget(aOKBtn);
316 aBtnLayout->addWidget(aApplyBtn);
317 aBtnLayout->addStretch();
318 aBtnLayout->addWidget(aCloseBtn);
320 /***************************************************************/
321 aMainLayout->addWidget(meshGroupLab, 0, 0);
322 aMainLayout->addWidget(myMeshGroupBtn, 0, 1);
323 aMainLayout->addWidget(myMeshGroupLine, 0, 2);
324 aMainLayout->addMultiCellWidget(myTypeGroup, 1, 1, 0, 2);
325 aMainLayout->addWidget(aName, 2, 0);
326 aMainLayout->addWidget(myName, 2, 2);
327 aMainLayout->addMultiCellWidget(myGrpTypeGroup, 3, 3, 0, 2);
328 aMainLayout->addMultiCellWidget(myWGStack, 4, 4, 0, 2);
329 aMainLayout->setRowStretch( 5, 5 );
330 aMainLayout->addMultiCellWidget(aButtons, 6, 6, 0, 2);
332 /* signals and slots connections */
333 connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
335 connect(myGrpTypeGroup, SIGNAL(clicked(int)), this, SLOT(onGrpTypeChanged(int)));
337 connect(myTypeGroup, SIGNAL(clicked(int)), this, SLOT(onTypeChanged(int)));
339 connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
340 connect(myElements, SIGNAL(selectionChanged()), this, SLOT(onListSelectionChanged()));
342 connect(myFilter, SIGNAL(clicked()), this, SLOT(setFilters()));
343 connect(aAddBtn, SIGNAL(clicked()), this, SLOT(onAdd()));
344 connect(aRemoveBtn, SIGNAL(clicked()), this, SLOT(onRemove()));
345 connect(aSortBtn, SIGNAL(clicked()), this, SLOT(onSort()));
347 connect(mySelectSubMesh, SIGNAL(toggled(bool)), this, SLOT(onSelectSubMesh(bool)));
348 connect(mySelectGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool)));
349 connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
350 connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
351 connect(myGeomGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
353 connect(aOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
354 connect(aApplyBtn, SIGNAL(clicked()), this, SLOT(onApply()));
355 connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(onClose()));
358 mySMESHGUI->SetActiveDialogBox(this);
359 mySMESHGUI->SetState(800);
361 mySelectionMode = -1;
362 myMeshFilter = new SMESH_TypeFilter(MESH);
363 mySubMeshFilter = new SMESH_TypeFilter(SUBMESH);
364 myGroupFilter = new SMESH_TypeFilter(GROUP);
366 connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
367 connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onClose()));
368 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged()));
370 myGrpTypeGroup->setButton(myGrpTypeGroup->id(rb1)); // VSR !!!
371 onGrpTypeChanged(myGrpTypeGroup->id(rb1)); // VSR!!!
373 if (myMesh->_is_nil() )
374 myTypeGroup->setButton(0);
379 //=================================================================================
380 // function : ~SMESHGUI_GroupDlg()
381 // purpose : Destroys the object and frees any allocated resources
382 //=================================================================================
383 SMESHGUI_GroupDlg::~SMESHGUI_GroupDlg()
385 // no need to delete child widgets, Qt does it all for us
386 if ( myFilterDlg != 0 )
388 myFilterDlg->reparent( 0, QPoint() );
393 //=================================================================================
396 //=================================================================================
397 void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
399 /* init data from current selection */
400 myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
401 myGroup = SMESH::SMESH_Group::_nil();
403 myActor = SMESH::FindActorByObject(myMesh);
404 SMESH::SetPickable(myActor);
406 const SALOME_ListIO& aList = mySelector->StoredIObjects();
408 QString aName = aList.First()->getName();
409 myMeshGroupLine->setText(aName) ;
410 myMeshGroupLine->home( false );
412 myCurrentLineEdit = 0;
414 myTypeGroup->setButton(0);
418 //=================================================================================
421 //=================================================================================
422 void SMESHGUI_GroupDlg::init (SMESH::SMESH_Group_ptr theGroup)
424 myMesh = theGroup->GetMesh();
425 myGroup = SMESH::SMESH_Group::_duplicate(theGroup);
427 myActor = SMESH::FindActorByObject(myMesh);
429 myActor = SMESH::FindActorByObject(myGroup);
430 SMESH::SetPickable(myActor);
433 switch(theGroup->GetType()) {
434 case SMESH::NODE: aType= 0; break;
435 case SMESH::EDGE: aType = 1; break;
436 case SMESH::FACE: aType = 2; break;
437 case SMESH::VOLUME: aType = 3; break;
440 myName->setText(myGroup->GetName());
442 myMeshGroupLine->setText(myGroup->GetName());
444 myCurrentLineEdit = 0;
445 myTypeGroup->setButton(aType);
447 setSelectionMode(aType);
451 if (!theGroup->IsEmpty()) {
452 SMESH::long_array_var anElements = myGroup->GetListOfID();
453 int k = anElements->length();
454 for (int i = 0; i < k; i++) {
455 myIdList.append(anElements[i]);
456 myElements->insertItem(QString::number(anElements[i]));
458 myElements->selectAll(true);
462 //=================================================================================
463 // function : updateButtons()
465 //=================================================================================
466 void SMESHGUI_GroupDlg::updateButtons()
470 if (myGrpTypeId == 0)
471 enable = !myName->text().stripWhiteSpace().isEmpty() && myElements->count() > 0;
472 else if (myGrpTypeId == 1)
473 enable = !myName->text().stripWhiteSpace().isEmpty() && !CORBA::is_nil( myGeomGroup );
475 aBtn = (QPushButton*) child("ok", "QPushButton");
476 if (aBtn) aBtn->setEnabled(enable);
477 aBtn = (QPushButton*) child("apply", "QPushButton");
478 if (aBtn) aBtn->setEnabled(enable);
481 //=================================================================================
482 // function : onNameChanged()
484 //=================================================================================
485 void SMESHGUI_GroupDlg::onNameChanged (const QString& text)
490 //=================================================================================
491 // function : onTypeChanged()
492 // purpose : Group elements type radio button management
493 //=================================================================================
494 void SMESHGUI_GroupDlg::onTypeChanged (int id)
496 if (myTypeId != id) {
498 if (myCurrentLineEdit == 0)
499 setSelectionMode(id);
504 //=================================================================================
505 // function : onGrpTypeChanged()
506 // purpose : Group type radio button management
507 //=================================================================================
508 void SMESHGUI_GroupDlg::onGrpTypeChanged (int id)
510 if (myGrpTypeId != id) {
511 myWGStack->raiseWidget( id );
512 onSelectGeomGroup(id == 1);
517 //=================================================================================
518 // function : setSelectionMode()
519 // purpose : Radio button management
520 //=================================================================================
521 void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
524 if (myMesh->_is_nil())
527 if (mySelectionMode != theMode) {
528 mySelectionMgr->clearSelected();
529 mySelectionMgr->clearFilters();
530 SMESH::SetPointRepresentation(false);
535 myActor->SetPointRepresentation(true);
537 SMESH::SetPointRepresentation(true);
538 myViewWindow->SetSelectionMode(NodeSelection);
541 myViewWindow->SetSelectionMode(EdgeSelection);
544 myViewWindow->SetSelectionMode(FaceSelection);
547 myViewWindow->SetSelectionMode(VolumeSelection);
550 myViewWindow->SetSelectionMode(ActorSelection);
552 mySelectionMgr->installFilter(mySubMeshFilter);
553 else if (theMode == 5)
554 mySelectionMgr->installFilter(myGroupFilter);
555 else if (theMode == 6)
556 mySelectionMgr->installFilter(myMeshFilter);
558 mySelectionMode = theMode;
562 //=================================================================================
563 // function : onApply()
565 //=================================================================================
566 bool SMESHGUI_GroupDlg::onApply()
568 if (mySMESHGUI->isActiveStudyLocked())
571 if (myGrpTypeId == 0 &&
572 !myName->text().stripWhiteSpace().isEmpty() &&
573 myElements->count() > 0) {
574 mySelectionMgr->clearSelected();
575 if (myGroup->_is_nil()) {
576 SMESH::ElementType aType = SMESH::ALL;
578 case 0: aType = SMESH::NODE; break;
579 case 1: aType = SMESH::EDGE; break;
580 case 2: aType = SMESH::FACE; break;
581 case 3: aType = SMESH::VOLUME; break;
583 SMESH::long_array_var anIdList = new SMESH::long_array;
584 int i, k = myElements->count();
586 QListBoxItem* anItem;
587 for (i = 0, anItem = myElements->firstItem(); anItem != 0; i++, anItem = anItem->next()) {
588 anIdList[i] = anItem->text().toInt();
591 myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
592 myGroup->Add(anIdList.inout());
594 /* init for next operation */
597 myGroup = SMESH::SMESH_Group::_nil();
600 myGroup->SetName(myName->text());
602 QValueList<int> aAddList;
603 QValueList<int>::iterator anIt;
604 QListBoxItem* anItem;
606 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
607 int anId = anItem->text().toInt();
608 if ((anIt = myIdList.find(anId)) == myIdList.end())
609 aAddList.append(anId);
611 myIdList.remove(anIt);
613 if (!aAddList.empty()) {
614 SMESH::long_array_var anIdList = new SMESH::long_array;
615 anIdList->length(aAddList.count());
617 for (i = 0, anIt = aAddList.begin(); anIt != aAddList.end(); anIt++, i++)
619 myGroup->Add(anIdList.inout());
621 if (!myIdList.empty()) {
622 SMESH::long_array_var anIdList = new SMESH::long_array;
623 anIdList->length(myIdList.count());
625 for (i = 0, anIt = myIdList.begin(); anIt != myIdList.end(); anIt++, i++)
627 myGroup->Remove(anIdList.inout());
629 /* init for next operation */
631 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next())
632 myIdList.append(anItem->text().toInt());
635 mySMESHGUI->updateObjBrowser(true);
636 SMESH::UpdateView(); // asv: fix of BUG PAL5515
637 mySelectionMgr->clearSelected();
639 } else if (myGrpTypeId == 1 &&
640 !myName->text().stripWhiteSpace().isEmpty() &&
641 !CORBA::is_nil(myGeomGroup))
643 SMESH::ElementType aType = SMESH::ALL;
645 case 0: aType = SMESH::NODE; break;
646 case 1: aType = SMESH::EDGE; break;
647 case 2: aType = SMESH::FACE; break;
648 case 3: aType = SMESH::VOLUME; break;
651 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
652 GEOM::GEOM_IGroupOperations_var aGroupOp =
653 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
655 SMESH::SMESH_GroupOnGeom_var aGroupOnGeom =
656 myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomGroup);
658 mySMESHGUI->updateObjBrowser(true);
659 mySelectionMgr->clearSelected();
660 /* init for next operation */
668 //=================================================================================
671 //=================================================================================
672 void SMESHGUI_GroupDlg::onOK()
678 static bool busy = false;
679 //=================================================================================
680 // function : onListSelectionChanged()
681 // purpose : Called when selection in element list is changed
682 //=================================================================================
683 void SMESHGUI_GroupDlg::onListSelectionChanged()
685 // MESSAGE("SMESHGUI_GroupDlg::onListSelectionChanged(); myActor = " << myActor);
686 if (busy || !myActor) return;
689 if (myCurrentLineEdit == 0) {
690 mySelectionMgr->clearSelected();
691 TColStd_MapOfInteger aIndexes;
692 QListBoxItem* anItem;
693 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
694 if (anItem->isSelected()) {
695 int anId = anItem->text().toInt();
699 mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
701 aList.Append(myActor->getIO());
702 mySelectionMgr->setSelectedObjects(aList,false);
703 myViewWindow->highlight( myActor->getIO(), true, true );
708 //=================================================================================
709 // function : onObjectSelectionChanged()
710 // purpose : Called when selection in 3D view or ObjectBrowser is changed
711 //=================================================================================
712 void SMESHGUI_GroupDlg::onObjectSelectionChanged()
714 if (busy || !isEnabled()) return;
717 const SALOME_ListIO& aList = mySelector->StoredIObjects();
719 int aNbSel = aList.Extent();
720 myElements->clearSelection();
722 if (myCurrentLineEdit) {
723 myCurrentLineEdit->setText("");
724 QString aString = "";
726 if (myCurrentLineEdit == myMeshGroupLine) {
727 mySelectSubMesh->setEnabled(false);
728 mySelectGroup->setEnabled(false);
729 myGroupLine->setText("");
730 mySubMeshLine->setText("");
732 myGeomGroupBtn->setEnabled(false);
733 myGeomGroupLine->setEnabled(false);
734 myGeomGroupLine->setText("");
741 myGroup = SMESH::SMESH_Group::_nil();
742 myMesh = SMESH::SMESH_Mesh::_nil();
746 Handle(SALOME_InteractiveObject) IO = aList.First();
749 myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
750 if (myMesh->_is_nil())
755 myGroup = SMESH::SMESH_Group::_nil();
757 myActor = SMESH::FindActorByObject(myMesh);
758 SMESH::SetPickable(myActor);
760 aString = aList.First()->getName();
761 myMeshGroupLine->setText(aString) ;
762 myMeshGroupLine->home( false );
764 mySelectSubMesh->setEnabled(true);
765 mySelectGroup->setEnabled(true);
766 myGeomGroupBtn->setEnabled(true);
767 myGeomGroupLine->setEnabled(true);
770 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(IO);
771 if (aGroup->_is_nil())
777 myCurrentLineEdit = 0;
780 mySelectSubMesh->setEnabled(true);
781 mySelectGroup->setEnabled(true);
782 myGeomGroupBtn->setEnabled(true);
783 myGeomGroupLine->setEnabled(true);
785 myCurrentLineEdit = 0;
797 setSelectionMode(myTypeId);
803 } else if (myCurrentLineEdit == myGeomGroupLine) {
805 myGeomGroup = GEOM::GEOM_Object::_nil();
810 Standard_Boolean testResult = Standard_False;
811 myGeomGroup = GEOMBase::ConvertIOinGEOMObject(aList.First(), testResult);
813 // Check if the object is a geometry group
814 if (!testResult || CORBA::is_nil(myGeomGroup)) {
815 myGeomGroup = GEOM::GEOM_Object::_nil();
819 // Check if group constructed on the same shape as a mesh or on its child
820 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
821 GEOM::GEOM_IGroupOperations_var anOp =
822 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
824 // The main shape of the group
825 GEOM::GEOM_Object_var aGroupMainShape;
826 if (myGeomGroup->GetType() == 37)
827 aGroupMainShape = anOp->GetMainShape(myGeomGroup);
829 aGroupMainShape = GEOM::GEOM_Object::_duplicate(myGeomGroup);
830 _PTR(SObject) aGroupMainShapeSO =
831 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
832 aStudy->FindObjectIOR(aGroupMainShape->GetStudyEntry());
835 _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
837 myGeomGroup = GEOM::GEOM_Object::_nil();
841 _PTR(SObject) anObj, aRef;
842 bool isRefOrSubShape = false;
843 if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) {
844 //if (strcmp(aRef->GetID(), aGroupMainShapeSO->GetID()) == 0) {
845 if (aRef->GetID() == aGroupMainShapeSO->GetID()) {
846 isRefOrSubShape = true;
848 _PTR(SObject) aFather = aGroupMainShapeSO->GetFather();
849 _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent();
850 //while (!isRefOrSubShape && strcmp(aFather->GetID(), aComponent->GetID()) != 0) {
851 while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) {
852 //if (strcmp(aRef->GetID(), aFather->GetID()) == 0)
853 if (aRef->GetID() == aFather->GetID())
854 isRefOrSubShape = true;
856 aFather = aFather->GetFather();
860 if (!isRefOrSubShape) {
861 myGeomGroup = GEOM::GEOM_Object::_nil();
869 if (myCurrentLineEdit == mySubMeshLine)
870 aString = tr("SMESH_SUBMESH_SELECTED").arg(aNbSel);
871 else if (myCurrentLineEdit == myGroupLine || myCurrentLineEdit == myGeomGroupLine)
872 aString = tr("SMESH_GROUP_SELECTED").arg(aNbSel);
874 aString = aList.First()->getName();
878 myCurrentLineEdit->setText(aString);
879 myCurrentLineEdit->home(false);
885 QString aListStr = "";
888 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
890 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
893 QStringList anElements = QStringList::split(" ", aListStr);
894 QListBoxItem* anItem = 0;
895 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
896 anItem = myElements->findItem(*it, Qt::ExactMatch);
897 if (anItem) myElements->setSelected(anItem, true);
904 if (!myGroup->_is_nil())
905 myActor = SMESH::FindActorByObject(myGroup);
907 myActor = SMESH::FindActorByObject(myMesh);
913 //=================================================================================
914 // function : onSelectSubMesh()
915 // purpose : Called when selection in 3D view or ObjectBrowser is changed
916 //=================================================================================
917 void SMESHGUI_GroupDlg::onSelectSubMesh(bool on)
920 if (mySelectGroup->isChecked()) {
921 mySelectGroup->setChecked(false);
923 //VSR: else if (mySelectGeomGroup->isChecked()) {
924 //VSR: mySelectGeomGroup->setChecked(false);
926 myCurrentLineEdit = mySubMeshLine;
930 mySubMeshLine->setText("");
931 myCurrentLineEdit = 0;
933 setSelectionMode(myTypeId);
935 mySubMeshBtn->setEnabled(on);
936 mySubMeshLine->setEnabled(on);
940 //=================================================================================
941 // function : (onSelectGroup)
942 // purpose : Called when selection in 3D view or ObjectBrowser is changed
943 //=================================================================================
944 void SMESHGUI_GroupDlg::onSelectGroup(bool on)
947 if (mySelectSubMesh->isChecked()) {
948 mySelectSubMesh->setChecked(false);
950 myCurrentLineEdit = myGroupLine;
954 myGroupLine->setText("");
955 myCurrentLineEdit = 0;
957 setSelectionMode(myTypeId);
959 myGroupBtn->setEnabled(on);
960 myGroupLine->setEnabled(on);
964 //=================================================================================
965 // function : (onSelectGeomGroup)
966 // purpose : Called when selection in 3D view or ObjectBrowser is changed
967 //=================================================================================
968 void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
971 if (mySelectSubMesh->isChecked()) {
972 mySelectSubMesh->setChecked(false);
974 else if (mySelectGroup->isChecked()) {
975 mySelectGroup->setChecked(false);
977 myCurrentLineEdit = myGeomGroupLine;
981 myGeomGroupLine->setText("");
982 myCurrentLineEdit = 0;
984 setSelectionMode(myTypeId);
989 //=================================================================================
990 // function : setCurrentSelection()
992 //=================================================================================
993 void SMESHGUI_GroupDlg::setCurrentSelection()
995 QPushButton* send = (QPushButton*)sender();
996 myCurrentLineEdit = 0;
997 if (send == myMeshGroupBtn) {
998 myCurrentLineEdit = myMeshGroupLine;
1000 setSelectionMode(6);
1002 setSelectionMode(5);
1003 onObjectSelectionChanged();
1005 else if (send == mySubMeshBtn) {
1006 myCurrentLineEdit = mySubMeshLine;
1007 onObjectSelectionChanged();
1009 else if (send == myGroupBtn) {
1010 myCurrentLineEdit = myGroupLine;
1011 onObjectSelectionChanged();
1013 else if (send == myGeomGroupBtn) {
1014 myCurrentLineEdit = myGeomGroupLine;
1015 setSelectionMode(7);
1016 onObjectSelectionChanged();
1021 //=================================================================================
1022 // function : setFilters()
1023 // purpose : SLOT. Called when "Filter" button pressed.
1024 //=================================================================================
1025 void SMESHGUI_GroupDlg::setFilters()
1027 SMESH::ElementType aType = SMESH::ALL;
1030 case 0 : aType = SMESH::NODE; break;
1031 case 1 : aType = SMESH::EDGE; break;
1032 case 2 : aType = SMESH::FACE; break;
1033 case 3 : aType = SMESH::VOLUME; break;
1037 if ( myFilterDlg == 0 )
1039 myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, aType );
1040 connect( myFilterDlg, SIGNAL( Accepted() ), SLOT( onFilterAccepted() ) );
1043 myFilterDlg->Init( aType );
1045 myFilterDlg->SetSelection();
1046 myFilterDlg->SetMesh( myMesh );
1047 myFilterDlg->SetSourceWg( myElements );
1049 myFilterDlg->show();
1052 //=================================================================================
1053 // function : onFilterAccepted()
1054 // purpose : SLOT. Called when Filter dlg closed with OK button.
1055 // Uncheck "Select submesh" and "Select group" checkboxes
1056 //=================================================================================
1057 void SMESHGUI_GroupDlg::onFilterAccepted()
1059 if ( mySelectSubMesh->isChecked() || mySelectGroup->isChecked() )
1061 mySelectionMode = myTypeId;
1062 mySelectSubMesh->setChecked( false );
1063 mySelectGroup->setChecked( false );
1067 //=================================================================================
1068 // function : onAdd()
1070 //=================================================================================
1071 void SMESHGUI_GroupDlg::onAdd()
1073 const SALOME_ListIO& aList = mySelector->StoredIObjects();
1074 int aNbSel = aList.Extent();
1076 if (aNbSel == 0 || !myActor || myMesh->_is_nil()) return;
1080 SMESH::ElementType aType = SMESH::ALL;
1082 case 0: aType = SMESH::NODE; break;
1083 case 1: aType = SMESH::EDGE; break;
1084 case 2: aType = SMESH::FACE; break;
1085 case 3: aType = SMESH::VOLUME; break;
1088 if (myCurrentLineEdit == 0) {
1089 //if (aNbSel != 1) { busy = false; return; }
1090 QString aListStr = "";
1092 if (myTypeId == 0) {
1093 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
1096 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
1099 QStringList anElements = QStringList::split(" ", aListStr);
1100 QListBoxItem* anItem = 0;
1101 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
1102 anItem = myElements->findItem(*it, Qt::ExactMatch);
1104 anItem = new QListBoxText(*it);
1105 myElements->insertItem(anItem);
1107 myElements->setSelected(anItem, true);
1110 } else if (myCurrentLineEdit == mySubMeshLine) {
1111 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1112 const SALOME_ListIO& aList = mySelector->StoredIObjects();
1113 SALOME_ListIteratorOfListIO anIt (aList);
1114 for (; anIt.More(); anIt.Next()) {
1115 SMESH::SMESH_subMesh_var aSubMesh =
1116 SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1117 if (!aSubMesh->_is_nil()) {
1118 // check if mesh is the same
1119 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1121 SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
1122 int k = anElements->length();
1123 QListBoxItem* anItem = 0;
1124 for (int i = 0; i < k; i++) {
1125 QString aText = QString::number(anElements[i]);
1126 anItem = myElements->findItem(aText, Qt::ExactMatch);
1128 anItem = new QListBoxText(aText);
1129 myElements->insertItem(anItem);
1131 myElements->setSelected(anItem, true);
1134 catch (const SALOME::SALOME_Exception& ex) {
1135 SalomeApp_Tools::QtCatchCorbaException(ex);
1140 mySelectSubMesh->setChecked(false);
1142 onListSelectionChanged();
1144 } else if (myCurrentLineEdit == myGroupLine) {
1145 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1146 const SALOME_ListIO& aList = mySelector->StoredIObjects();
1147 SALOME_ListIteratorOfListIO anIt (aList);
1148 for (; anIt.More(); anIt.Next()) {
1149 SMESH::SMESH_Group_var aGroup =
1150 SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1151 if (!aGroup->_is_nil()) {
1152 // check if mesh is the same
1153 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1154 SMESH::long_array_var anElements = aGroup->GetListOfID();
1155 int k = anElements->length();
1156 QListBoxItem* anItem = 0;
1157 for (int i = 0; i < k; i++) {
1158 QString aText = QString::number(anElements[i]);
1159 anItem = myElements->findItem(aText, Qt::ExactMatch);
1161 anItem = new QListBoxText(aText);
1162 myElements->insertItem(anItem);
1164 myElements->setSelected(anItem, true);
1169 mySelectGroup->setChecked(false);
1171 onListSelectionChanged();
1173 } else if (myCurrentLineEdit == myGeomGroupLine && !CORBA::is_nil(myGeomGroup)) {
1174 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
1175 GEOM::GEOM_IGroupOperations_var aGroupOp =
1176 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
1178 SMESH::ElementType aGroupType = SMESH::ALL;
1179 switch(aGroupOp->GetType(myGeomGroup)) {
1180 case 7: aGroupType = SMESH::NODE; break;
1181 case 6: aGroupType = SMESH::EDGE; break;
1182 case 4: aGroupType = SMESH::FACE; break;
1183 case 2: aGroupType = SMESH::VOLUME; break;
1184 default: busy = false; return;
1187 if (aGroupType == aType) {
1188 _PTR(SObject) aGroupSO =
1189 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
1190 aStudy->FindObjectIOR(myGeomGroup->GetStudyEntry());
1192 SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
1193 SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
1194 SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom();;
1195 aBelongToGeom->SetGeom(myGeomGroup);
1196 aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str());
1197 aBelongToGeom->SetElementType(aType);
1198 aFilter->SetPredicate(aBelongToGeom);
1200 SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh);
1202 int k = anElements->length();
1203 QListBoxItem* anItem = 0;
1204 for (int i = 0; i < k; i++) {
1205 QString aText = QString::number(anElements[i]);
1206 anItem = myElements->findItem(aText, Qt::ExactMatch);
1208 anItem = new QListBoxText(aText);
1209 myElements->insertItem(anItem);
1211 myElements->setSelected(anItem, true);
1215 //VSR: mySelectGeomGroup->setChecked(false);
1217 onListSelectionChanged();
1220 // mySelectionMgr->clearSelected();
1224 //=================================================================================
1225 // function : onRemove()
1227 //=================================================================================
1228 void SMESHGUI_GroupDlg::onRemove()
1231 if (myCurrentLineEdit == 0) {
1232 for (int i = myElements->count(); i > 0; i--) {
1233 if (myElements->isSelected(i-1)) {
1234 myElements->removeItem(i-1);
1238 const SALOME_ListIO& aList = mySelector->StoredIObjects();
1239 int aNbSel = aList.Extent();
1241 if (aNbSel == 0) { busy = false; return; }
1243 SMESH::ElementType aType = SMESH::ALL;
1245 case 0: aType = SMESH::NODE; break;
1246 case 1: aType = SMESH::EDGE; break;
1247 case 2: aType = SMESH::FACE; break;
1248 case 3: aType = SMESH::VOLUME; break;
1251 if (myCurrentLineEdit == mySubMeshLine) {
1252 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1253 const SALOME_ListIO& aList = mySelector->StoredIObjects();
1254 SALOME_ListIteratorOfListIO anIt (aList);
1255 for (; anIt.More(); anIt.Next()) {
1256 SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1257 if (!aSubMesh->_is_nil()) {
1258 // check if mesh is the same
1259 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1260 if (aType == SMESH::NODE) {
1262 SMESH::long_array_var anElements = aSubMesh->GetNodesId();
1263 int k = anElements->length();
1264 QListBoxItem* anItem = 0;
1265 for (int i = 0; i < k; i++) {
1266 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1267 if (anItem) delete anItem;
1270 catch (const SALOME::SALOME_Exception& ex) {
1271 SalomeApp_Tools::QtCatchCorbaException(ex);
1276 SMESH::long_array_var anElements = aSubMesh->GetElementsId();
1277 int k = anElements->length();
1278 QListBoxItem* anItem = 0;
1279 for (int i = 0; i < k; i++) {
1280 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1281 if (anItem) delete anItem;
1284 catch (const SALOME::SALOME_Exception& ex) {
1285 SalomeApp_Tools::QtCatchCorbaException(ex);
1292 else if (myCurrentLineEdit == myGroupLine) {
1293 Standard_Boolean aRes;
1294 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1295 const SALOME_ListIO& aList = mySelector->StoredIObjects();
1296 SALOME_ListIteratorOfListIO anIt (aList);
1297 for (; anIt.More(); anIt.Next()) {
1298 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1299 if (aRes && !aGroup->_is_nil()) {
1300 // check if mesh is the same
1301 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1302 SMESH::long_array_var anElements = aGroup->GetListOfID();
1303 int k = anElements->length();
1304 QListBoxItem* anItem = 0;
1305 for (int i = 0; i < k; i++) {
1306 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1307 if (anItem) delete anItem;
1318 //=================================================================================
1319 // function : onSort()
1321 //=================================================================================
1322 void SMESHGUI_GroupDlg::onSort()
1324 // PAL5412: sorts items in ascending by "string" value
1325 // myElements->sort(true);
1326 // myElements->update();
1327 int i, k = myElements->count();
1330 QStringList aSelected;
1331 std::vector<int> anArray(k);
1332 // QMemArray<int> anArray(k);
1333 QListBoxItem* anItem;
1335 for (anItem = myElements->firstItem(), i = 0; anItem != 0; anItem = anItem->next(), i++) {
1336 anArray[i] = anItem->text().toInt();
1337 if (anItem->isSelected())
1338 aSelected.append(anItem->text());
1340 // sort & update list
1341 std::sort(anArray.begin(), anArray.end());
1343 myElements->clear();
1344 for (i = 0; i < k; i++) {
1345 myElements->insertItem(QString::number(anArray[i]));
1347 for (QStringList::iterator it = aSelected.begin(); it != aSelected.end(); ++it) {
1348 anItem = myElements->findItem(*it, Qt::ExactMatch);
1349 if (anItem) myElements->setSelected(anItem, true);
1355 //=================================================================================
1356 // function : closeEvent()
1358 //=================================================================================
1359 void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*)
1364 //=================================================================================
1365 // function : SMESHGUI_GroupDlg::onClose
1366 // purpose : SLOT called when "Close" button pressed. Close dialog
1367 //=================================================================================
1368 void SMESHGUI_GroupDlg::onClose()
1370 if (SMESH::GetCurrentVtkView()) {
1371 SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
1372 SMESH::SetPointRepresentation(false);
1373 SMESH::SetPickable();
1376 mySelectionMgr->clearSelected();
1377 myViewWindow->SetSelectionMode(ActorSelection);
1378 mySelectionMgr->clearFilters();
1379 mySMESHGUI->ResetState();
1384 //=================================================================================
1385 // function : SMESHGUI_GroupDlg::onDeactivate
1386 // purpose : SLOT called when dialog must be deativated
1387 //=================================================================================
1388 void SMESHGUI_GroupDlg::onDeactivate()
1390 mySMESHGUI->ResetState();
1394 //=================================================================================
1395 // function : SMESHGUI_GroupDlg::enterEvent
1396 // purpose : Event filter
1397 //=================================================================================
1398 void SMESHGUI_GroupDlg::enterEvent (QEvent*)
1401 mySMESHGUI->EmitSignalDeactivateDialog();
1403 mySelectionMode = -1;
1404 setSelectionMode(myTypeId);
1405 //mySMESHGUI->SetActiveDialogBox((QDialog*)this);
1406 mySMESHGUI->SetActiveDialogBox(this);
1407 mySMESHGUI->SetState(800);
1411 //=================================================================================
1412 // function : hideEvent
1413 // purpose : caused by ESC key
1414 //=================================================================================
1415 void SMESHGUI_GroupDlg::hideEvent (QHideEvent*)