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 ) ),
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 mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
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 ) ),
126 if (!name) setName("SMESHGUI_GroupDlg");
128 mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
131 if (!theGroup->_is_nil())
134 mySelectSubMesh->setEnabled(false);
135 mySelectGroup->setEnabled(false);
137 myCurrentLineEdit = myMeshGroupLine;
141 /* Move widget on the botton right corner of main widget */
143 mySMESHGUI->DefineDlgPosition(this, x, y);
147 //=================================================================================
148 // function : SMESHGUI_GroupDlg()
150 //=================================================================================
151 void SMESHGUI_GroupDlg::initDialog(bool create)
155 myCurrentLineEdit = 0;
157 QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
160 setCaption(tr("SMESH_CREATE_GROUP_TITLE"));
162 setCaption(tr("SMESH_EDIT_GROUP_TITLE"));
164 setSizeGripEnabled(TRUE);
166 QGridLayout* aMainLayout = new QGridLayout(this, 7, 3, 11, 6);
168 /***************************************************************/
169 QLabel* meshGroupLab = new QLabel(this, "mesh/group label");
171 meshGroupLab->setText(tr("SMESH_MESH"));
173 meshGroupLab->setText(tr("SMESH_GROUP"));
174 myMeshGroupBtn = new QPushButton(this, "mesh/group button");
175 myMeshGroupBtn->setPixmap(image0);
176 myMeshGroupLine = new QLineEdit(this, "mesh/group line");
177 myMeshGroupLine->setReadOnly(true);
179 /***************************************************************/
180 myTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Group types");
181 myTypeGroup->setTitle(tr("SMESH_ELEMENTS_TYPE"));
182 myTypeGroup->setExclusive(true);
185 types.append(tr("MESH_NODE"));
186 types.append(tr("SMESH_EDGE"));
187 types.append(tr("SMESH_FACE"));
188 types.append(tr("SMESH_VOLUME"));
190 for (int i = 0; i < types.count(); i++) {
191 rb = new QRadioButton(types[i], myTypeGroup);
193 myTypeGroup->setEnabled(create);
196 /***************************************************************/
197 QLabel* aName = new QLabel(this, "name label");
198 aName->setText(tr("SMESH_NAME"));
199 aName->setMinimumSize(50,0);
200 myName = new QLineEdit(this, "name");
202 /***************************************************************/
203 myGrpTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Type of group");
204 myGrpTypeGroup->setTitle(tr("SMESH_GROUP_TYPE"));
205 myGrpTypeGroup->setExclusive(true);
206 QRadioButton* rb1 = new QRadioButton( tr("SMESH_GROUP_STANDALONE"), myGrpTypeGroup);
207 QRadioButton* rb2 = new QRadioButton( tr("SMESH_GROUP_GEOMETRY"), myGrpTypeGroup);
208 myGrpTypeGroup->setEnabled(create);
211 /***************************************************************/
212 myWGStack = new QWidgetStack( this, "widget stack");
213 QWidget* wg1 = new QFrame( myWGStack, "first widget" );
214 QWidget* wg2 = new QFrame( myWGStack, "second widget" );
216 /***************************************************************/
217 QGroupBox* aContentBox = new QGroupBox(1, Qt::Horizontal, wg1, "content box");
218 aContentBox->setTitle(tr("SMESH_CONTENT"));
219 QFrame* aContent = new QFrame(aContentBox, "content");
220 QGridLayout* aLayout = new QGridLayout(aContent, 7, 4);
221 aLayout->setSpacing(6);
222 aLayout->setAutoAdd(false);
224 QLabel* aLabel = new QLabel(aContent, "elements label");
225 aLabel->setText(tr("SMESH_ID_ELEMENTS"));
226 myElements = new QListBox(aContent, "elements list");
227 myElements->setSelectionMode(QListBox::Extended);
229 myFilter = new QPushButton(aContent, "filter");
230 myFilter->setText(tr("SMESH_BUT_FILTER"));
231 QPushButton* aAddBtn = new QPushButton(aContent, "add");
232 aAddBtn->setText(tr("SMESH_BUT_ADD"));
233 QPushButton* aRemoveBtn = new QPushButton(aContent, "remove");
234 aRemoveBtn->setText(tr("SMESH_BUT_REMOVE"));
235 QPushButton* aSortBtn = new QPushButton(aContent, "sort");
236 aSortBtn->setText(tr("SMESH_BUT_SORT"));
238 aLayout->addWidget(aLabel, 0, 0);
239 aLayout->addMultiCellWidget(myElements, 1, 6, 0, 0);
240 aLayout->addWidget(myFilter, 1, 2);
241 aLayout->addWidget(aAddBtn, 3, 2);
242 aLayout->addWidget(aRemoveBtn, 4, 2);
243 aLayout->addWidget(aSortBtn, 6, 2);
245 aLayout->setColStretch(0, 1);
246 aLayout->addColSpacing(1, 20);
247 aLayout->addColSpacing(3, 20);
248 aLayout->setRowStretch(2, 1);
249 aLayout->setRowStretch(5, 1);
251 /***************************************************************/
252 QGroupBox* aSelectBox = new QGroupBox(3, Qt::Horizontal, wg1, "select box");
253 aSelectBox->setTitle(tr("SMESH_SELECT_FROM"));
255 mySelectSubMesh = new QCheckBox(aSelectBox, "submesh checkbox");
256 mySelectSubMesh->setText(tr("SMESH_SUBMESH"));
257 mySelectSubMesh->setMinimumSize(50, 0);
258 mySubMeshBtn = new QPushButton(aSelectBox, "submesh button");
259 mySubMeshBtn->setText("");
260 mySubMeshBtn->setPixmap(image0);
261 mySubMeshLine = new QLineEdit(aSelectBox, "submesh line");
262 mySubMeshLine->setReadOnly(true);
263 onSelectSubMesh(false);
265 mySelectGroup = new QCheckBox(aSelectBox, "group checkbox");
266 mySelectGroup->setText(tr("SMESH_GROUP"));
267 mySelectGroup->setMinimumSize(50, 0);
268 myGroupBtn = new QPushButton(aSelectBox, "group button");
269 myGroupBtn->setText("");
270 myGroupBtn->setPixmap(image0);
271 myGroupLine = new QLineEdit(aSelectBox, "group line");
272 myGroupLine->setReadOnly(true);
273 onSelectGroup(false);
275 /***************************************************************/
276 QGridLayout* wg1Layout = new QGridLayout( wg1, 3, 1, 0, 6 );
277 wg1Layout->addWidget(aContentBox, 0, 0);
278 wg1Layout->addWidget(aSelectBox, 1, 0);
279 wg1Layout->setRowStretch(2, 5);
281 /***************************************************************/
282 QLabel* geomObject = new QLabel(wg2, "geometry object label");
283 geomObject->setText(tr("SMESH_OBJECT_GEOM"));
284 myGeomGroupBtn = new QPushButton(wg2, "geometry group button");
285 myGeomGroupBtn->setText("");
286 myGeomGroupBtn->setPixmap(image0);
287 myGeomGroupLine = new QLineEdit(wg2, "geometry group line");
288 myGeomGroupLine->setReadOnly(true); //VSR ???
289 onSelectGeomGroup(false);
291 /***************************************************************/
292 QGridLayout* wg2Layout = new QGridLayout( wg2, 2, 3, 0, 6 );
293 wg2Layout->addWidget(geomObject, 0, 0);
294 wg2Layout->addWidget(myGeomGroupBtn, 0, 1);
295 wg2Layout->addWidget(myGeomGroupLine,0, 2);
296 wg2Layout->setRowStretch(1, 5);
298 /***************************************************************/
299 QVBoxLayout* dumb = new QVBoxLayout(myWGStack);
300 dumb->addWidget(wg1);
301 dumb->addWidget(wg2);
302 myWGStack->addWidget( wg1, myGrpTypeGroup->id(rb1) );
303 myWGStack->addWidget( wg2, myGrpTypeGroup->id(rb2) );
305 /***************************************************************/
306 QFrame* aButtons = new QFrame(this, "button box");
307 aButtons->setFrameStyle(QFrame::Box | QFrame::Sunken);
308 QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons, 11, 6);
309 aBtnLayout->setAutoAdd(false);
311 QPushButton* aOKBtn = new QPushButton(aButtons, "ok");
312 aOKBtn->setText(tr("SMESH_BUT_OK"));
313 aOKBtn->setAutoDefault(true);
314 aOKBtn->setDefault(true);
315 QPushButton* aApplyBtn = new QPushButton(aButtons, "apply");
316 aApplyBtn->setText(tr("SMESH_BUT_APPLY"));
317 aApplyBtn->setAutoDefault(true);
318 QPushButton* aCloseBtn = new QPushButton(aButtons, "close");
319 aCloseBtn->setText(tr("SMESH_BUT_CLOSE"));
320 aCloseBtn->setAutoDefault(true);
322 aBtnLayout->addWidget(aOKBtn);
323 aBtnLayout->addWidget(aApplyBtn);
324 aBtnLayout->addStretch();
325 aBtnLayout->addWidget(aCloseBtn);
327 /***************************************************************/
328 aMainLayout->addWidget(meshGroupLab, 0, 0);
329 aMainLayout->addWidget(myMeshGroupBtn, 0, 1);
330 aMainLayout->addWidget(myMeshGroupLine, 0, 2);
331 aMainLayout->addMultiCellWidget(myTypeGroup, 1, 1, 0, 2);
332 aMainLayout->addWidget(aName, 2, 0);
333 aMainLayout->addWidget(myName, 2, 2);
334 aMainLayout->addMultiCellWidget(myGrpTypeGroup, 3, 3, 0, 2);
335 aMainLayout->addMultiCellWidget(myWGStack, 4, 4, 0, 2);
336 aMainLayout->setRowStretch( 5, 5 );
337 aMainLayout->addMultiCellWidget(aButtons, 6, 6, 0, 2);
339 /* signals and slots connections */
340 connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
342 connect(myGrpTypeGroup, SIGNAL(clicked(int)), this, SLOT(onGrpTypeChanged(int)));
344 connect(myTypeGroup, SIGNAL(clicked(int)), this, SLOT(onTypeChanged(int)));
346 connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
347 connect(myElements, SIGNAL(selectionChanged()), this, SLOT(onListSelectionChanged()));
349 connect(myFilter, SIGNAL(clicked()), this, SLOT(setFilters()));
350 connect(aAddBtn, SIGNAL(clicked()), this, SLOT(onAdd()));
351 connect(aRemoveBtn, SIGNAL(clicked()), this, SLOT(onRemove()));
352 connect(aSortBtn, SIGNAL(clicked()), this, SLOT(onSort()));
354 connect(mySelectSubMesh, SIGNAL(toggled(bool)), this, SLOT(onSelectSubMesh(bool)));
355 connect(mySelectGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool)));
356 connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
357 connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
358 connect(myGeomGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
360 connect(aOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
361 connect(aApplyBtn, SIGNAL(clicked()), this, SLOT(onApply()));
362 connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(onClose()));
365 mySMESHGUI->SetActiveDialogBox(this);
366 mySMESHGUI->SetState(800);
368 mySelectionMode = -1;
369 myMeshFilter = new SMESH_TypeFilter(MESH);
370 mySubMeshFilter = new SMESH_TypeFilter(SUBMESH);
371 myGroupFilter = new SMESH_TypeFilter(GROUP);
373 connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
374 connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onClose()));
375 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged()));
377 myGrpTypeGroup->setButton(myGrpTypeGroup->id(rb1)); // VSR !!!
378 onGrpTypeChanged(myGrpTypeGroup->id(rb1)); // VSR!!!
380 if (myMesh->_is_nil() )
381 myTypeGroup->setButton(0);
386 //=================================================================================
387 // function : ~SMESHGUI_GroupDlg()
388 // purpose : Destroys the object and frees any allocated resources
389 //=================================================================================
390 SMESHGUI_GroupDlg::~SMESHGUI_GroupDlg()
392 // no need to delete child widgets, Qt does it all for us
393 if ( myFilterDlg != 0 )
395 myFilterDlg->reparent( 0, QPoint() );
400 //=================================================================================
403 //=================================================================================
404 void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
406 mySelectionMgr->installFilter(myMeshFilter);
408 /* init data from current selection */
409 myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
410 myGroup = SMESH::SMESH_Group::_nil();
412 myActor = SMESH::FindActorByObject(myMesh);
413 SMESH::SetPickable(myActor);
416 mySelectionMgr->selectedObjects( aList );
417 if( !aList.IsEmpty() )
419 QString aName = aList.First()->getName();
420 myMeshGroupLine->setText(aName) ;
421 myMeshGroupLine->home( false );
424 myCurrentLineEdit = 0;
426 myTypeGroup->setButton(0);
430 //=================================================================================
433 //=================================================================================
434 void SMESHGUI_GroupDlg::init (SMESH::SMESH_Group_ptr theGroup)
436 myMesh = theGroup->GetMesh();
437 myGroup = SMESH::SMESH_Group::_duplicate(theGroup);
439 myActor = SMESH::FindActorByObject(myMesh);
441 myActor = SMESH::FindActorByObject(myGroup);
442 SMESH::SetPickable(myActor);
445 switch(theGroup->GetType()) {
446 case SMESH::NODE: aType= 0; break;
447 case SMESH::EDGE: aType = 1; break;
448 case SMESH::FACE: aType = 2; break;
449 case SMESH::VOLUME: aType = 3; break;
452 myName->setText(myGroup->GetName());
454 myMeshGroupLine->setText(myGroup->GetName());
456 myCurrentLineEdit = 0;
457 myTypeGroup->setButton(aType);
459 setSelectionMode(aType);
463 if (!theGroup->IsEmpty()) {
464 SMESH::long_array_var anElements = myGroup->GetListOfID();
465 int k = anElements->length();
466 for (int i = 0; i < k; i++) {
467 myIdList.append(anElements[i]);
468 myElements->insertItem(QString::number(anElements[i]));
470 myElements->selectAll(true);
474 //=================================================================================
475 // function : updateButtons()
477 //=================================================================================
478 void SMESHGUI_GroupDlg::updateButtons()
482 if (myGrpTypeId == 0)
483 enable = !myName->text().stripWhiteSpace().isEmpty() && myElements->count() > 0;
484 else if (myGrpTypeId == 1)
485 enable = !myName->text().stripWhiteSpace().isEmpty() && !CORBA::is_nil( myGeomGroup );
487 aBtn = (QPushButton*) child("ok", "QPushButton");
488 if (aBtn) aBtn->setEnabled(enable);
489 aBtn = (QPushButton*) child("apply", "QPushButton");
490 if (aBtn) aBtn->setEnabled(enable);
493 //=================================================================================
494 // function : onNameChanged()
496 //=================================================================================
497 void SMESHGUI_GroupDlg::onNameChanged (const QString& text)
502 //=================================================================================
503 // function : onTypeChanged()
504 // purpose : Group elements type radio button management
505 //=================================================================================
506 void SMESHGUI_GroupDlg::onTypeChanged (int id)
508 if (myTypeId != id) {
510 if (myCurrentLineEdit == 0)
511 setSelectionMode(id);
516 //=================================================================================
517 // function : onGrpTypeChanged()
518 // purpose : Group type radio button management
519 //=================================================================================
520 void SMESHGUI_GroupDlg::onGrpTypeChanged (int id)
522 if (myGrpTypeId != id) {
523 myWGStack->raiseWidget( id );
524 onSelectGeomGroup(id == 1);
529 //=================================================================================
530 // function : setSelectionMode()
531 // purpose : Radio button management
532 //=================================================================================
533 void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
536 if (myMesh->_is_nil())
539 if (mySelectionMode != theMode) {
540 // [PAL10408] mySelectionMgr->clearSelected();
541 mySelectionMgr->clearFilters();
542 SMESH::SetPointRepresentation(false);
547 myActor->SetPointRepresentation(true);
549 SMESH::SetPointRepresentation(true);
550 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
551 aViewWindow->SetSelectionMode(NodeSelection);
554 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
555 aViewWindow->SetSelectionMode(EdgeSelection);
558 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
559 aViewWindow->SetSelectionMode(FaceSelection);
562 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
563 aViewWindow->SetSelectionMode(VolumeSelection);
566 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
567 aViewWindow->SetSelectionMode(ActorSelection);
569 mySelectionMgr->installFilter(mySubMeshFilter);
570 else if (theMode == 5)
571 mySelectionMgr->installFilter(myGroupFilter);
572 else if (theMode == 6)
573 mySelectionMgr->installFilter(myMeshFilter);
575 mySelectionMode = theMode;
579 //=================================================================================
580 // function : onApply()
582 //=================================================================================
583 bool SMESHGUI_GroupDlg::onApply()
585 if (mySMESHGUI->isActiveStudyLocked())
588 if (myGrpTypeId == 0 &&
589 !myName->text().stripWhiteSpace().isEmpty() &&
590 myElements->count() > 0) {
591 mySelectionMgr->clearSelected();
592 if (myGroup->_is_nil()) {
593 SMESH::ElementType aType = SMESH::ALL;
595 case 0: aType = SMESH::NODE; break;
596 case 1: aType = SMESH::EDGE; break;
597 case 2: aType = SMESH::FACE; break;
598 case 3: aType = SMESH::VOLUME; break;
600 SMESH::long_array_var anIdList = new SMESH::long_array;
601 int i, k = myElements->count();
603 QListBoxItem* anItem;
604 for (i = 0, anItem = myElements->firstItem(); anItem != 0; i++, anItem = anItem->next()) {
605 anIdList[i] = anItem->text().toInt();
608 myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
609 myGroup->Add(anIdList.inout());
611 /* init for next operation */
614 myGroup = SMESH::SMESH_Group::_nil();
617 myGroup->SetName(myName->text());
619 QValueList<int> aAddList;
620 QValueList<int>::iterator anIt;
621 QListBoxItem* anItem;
623 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
624 int anId = anItem->text().toInt();
625 if ((anIt = myIdList.find(anId)) == myIdList.end())
626 aAddList.append(anId);
628 myIdList.remove(anIt);
630 if (!aAddList.empty()) {
631 SMESH::long_array_var anIdList = new SMESH::long_array;
632 anIdList->length(aAddList.count());
634 for (i = 0, anIt = aAddList.begin(); anIt != aAddList.end(); anIt++, i++)
636 myGroup->Add(anIdList.inout());
638 if (!myIdList.empty()) {
639 SMESH::long_array_var anIdList = new SMESH::long_array;
640 anIdList->length(myIdList.count());
642 for (i = 0, anIt = myIdList.begin(); anIt != myIdList.end(); anIt++, i++)
644 myGroup->Remove(anIdList.inout());
646 /* init for next operation */
648 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next())
649 myIdList.append(anItem->text().toInt());
652 mySMESHGUI->updateObjBrowser(true);
653 SMESH::UpdateView(); // asv: fix of BUG PAL5515
654 mySelectionMgr->clearSelected();
656 } else if (myGrpTypeId == 1 &&
657 !myName->text().stripWhiteSpace().isEmpty() &&
658 !CORBA::is_nil(myGeomGroup))
660 SMESH::ElementType aType = SMESH::ALL;
662 case 0: aType = SMESH::NODE; break;
663 case 1: aType = SMESH::EDGE; break;
664 case 2: aType = SMESH::FACE; break;
665 case 3: aType = SMESH::VOLUME; break;
668 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
669 GEOM::GEOM_IGroupOperations_var aGroupOp =
670 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
672 SMESH::SMESH_GroupOnGeom_var aGroupOnGeom =
673 myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomGroup);
675 mySMESHGUI->updateObjBrowser(true);
676 mySelectionMgr->clearSelected();
677 /* init for next operation */
685 //=================================================================================
688 //=================================================================================
689 void SMESHGUI_GroupDlg::onOK()
695 //=================================================================================
696 // function : onListSelectionChanged()
697 // purpose : Called when selection in element list is changed
698 //=================================================================================
699 void SMESHGUI_GroupDlg::onListSelectionChanged()
701 // MESSAGE("SMESHGUI_GroupDlg::onListSelectionChanged(); myActor = " << myActor);
702 if( myIsBusy || !myActor) return;
705 if (myCurrentLineEdit == 0) {
706 mySelectionMgr->clearSelected();
707 TColStd_MapOfInteger aIndexes;
708 QListBoxItem* anItem;
709 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
710 if (anItem->isSelected()) {
711 int anId = anItem->text().toInt();
715 mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
717 aList.Append(myActor->getIO());
718 mySelectionMgr->setSelectedObjects(aList,false);
719 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
720 aViewWindow->highlight( myActor->getIO(), true, true );
725 //=================================================================================
726 // function : onObjectSelectionChanged()
727 // purpose : Called when selection in 3D view or ObjectBrowser is changed
728 //=================================================================================
729 void SMESHGUI_GroupDlg::onObjectSelectionChanged()
731 if ( myIsBusy || !isEnabled()) return;
735 mySelectionMgr->selectedObjects( aList );
737 int aNbSel = aList.Extent();
738 myElements->clearSelection();
740 if (myCurrentLineEdit) {
741 myCurrentLineEdit->setText("");
742 QString aString = "";
744 if (myCurrentLineEdit == myMeshGroupLine) {
745 mySelectSubMesh->setEnabled(false);
746 mySelectGroup->setEnabled(false);
747 myGroupLine->setText("");
748 mySubMeshLine->setText("");
750 myGeomGroupBtn->setEnabled(false);
751 myGeomGroupLine->setEnabled(false);
752 myGeomGroupLine->setText("");
759 myGroup = SMESH::SMESH_Group::_nil();
760 myMesh = SMESH::SMESH_Mesh::_nil();
764 Handle(SALOME_InteractiveObject) IO = aList.First();
767 myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
768 if (myMesh->_is_nil())
773 myGroup = SMESH::SMESH_Group::_nil();
775 myActor = SMESH::FindActorByObject(myMesh);
776 SMESH::SetPickable(myActor);
778 aString = aList.First()->getName();
779 myMeshGroupLine->setText(aString) ;
780 myMeshGroupLine->home( false );
782 mySelectSubMesh->setEnabled(true);
783 mySelectGroup->setEnabled(true);
784 myGeomGroupBtn->setEnabled(true);
785 myGeomGroupLine->setEnabled(true);
788 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(IO);
789 if (aGroup->_is_nil())
795 myCurrentLineEdit = 0;
798 mySelectSubMesh->setEnabled(true);
799 mySelectGroup->setEnabled(true);
800 myGeomGroupBtn->setEnabled(true);
801 myGeomGroupLine->setEnabled(true);
803 myCurrentLineEdit = 0;
812 setSelectionMode(myTypeId);
818 } else if (myCurrentLineEdit == myGeomGroupLine) {
820 myGeomGroup = GEOM::GEOM_Object::_nil();
825 Standard_Boolean testResult = Standard_False;
826 myGeomGroup = GEOMBase::ConvertIOinGEOMObject(aList.First(), testResult);
828 // Check if the object is a geometry group
829 if (!testResult || CORBA::is_nil(myGeomGroup)) {
830 myGeomGroup = GEOM::GEOM_Object::_nil();
834 // Check if group constructed on the same shape as a mesh or on its child
835 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
836 GEOM::GEOM_IGroupOperations_var anOp =
837 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
839 // The main shape of the group
840 GEOM::GEOM_Object_var aGroupMainShape;
841 if (myGeomGroup->GetType() == 37)
842 aGroupMainShape = anOp->GetMainShape(myGeomGroup);
844 aGroupMainShape = GEOM::GEOM_Object::_duplicate(myGeomGroup);
845 _PTR(SObject) aGroupMainShapeSO =
846 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
847 aStudy->FindObjectID(aGroupMainShape->GetStudyEntry());
850 _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
852 myGeomGroup = GEOM::GEOM_Object::_nil();
856 _PTR(SObject) anObj, aRef;
857 bool isRefOrSubShape = false;
858 if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) {
859 //if (strcmp(aRef->GetID(), aGroupMainShapeSO->GetID()) == 0) {
860 if (aRef->GetID() == aGroupMainShapeSO->GetID()) {
861 isRefOrSubShape = true;
863 _PTR(SObject) aFather = aGroupMainShapeSO->GetFather();
864 _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent();
865 //while (!isRefOrSubShape && strcmp(aFather->GetID(), aComponent->GetID()) != 0) {
866 while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) {
867 //if (strcmp(aRef->GetID(), aFather->GetID()) == 0)
868 if (aRef->GetID() == aFather->GetID())
869 isRefOrSubShape = true;
871 aFather = aFather->GetFather();
875 if (!isRefOrSubShape) {
876 myGeomGroup = GEOM::GEOM_Object::_nil();
884 if(myCurrentLineEdit == mySubMeshLine)
885 aString = tr("SMESH_SUBMESH_SELECTED").arg(aNbSel);
886 else if(myCurrentLineEdit == myGroupLine || myCurrentLineEdit == myGeomGroupLine)
887 aString = tr("SMESH_GROUP_SELECTED").arg(aNbSel);
889 aString = aList.First()->getName();
893 myCurrentLineEdit->setText(aString);
894 myCurrentLineEdit->home(false);
899 if (aNbSel == 1 && myActor ) {
900 QString aListStr = "";
903 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
905 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
908 QStringList anElements = QStringList::split(" ", aListStr);
909 QListBoxItem* anItem = 0;
910 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
911 anItem = myElements->findItem(*it, Qt::ExactMatch);
912 if (anItem) myElements->setSelected(anItem, true);
919 if (!myGroup->_is_nil())
920 myActor = SMESH::FindActorByObject(myGroup);
922 myActor = SMESH::FindActorByObject(myMesh);
928 //=================================================================================
929 // function : onSelectSubMesh()
930 // purpose : Called when selection in 3D view or ObjectBrowser is changed
931 //=================================================================================
932 void SMESHGUI_GroupDlg::onSelectSubMesh(bool on)
935 if (mySelectGroup->isChecked()) {
936 mySelectGroup->setChecked(false);
938 //VSR: else if (mySelectGeomGroup->isChecked()) {
939 //VSR: mySelectGeomGroup->setChecked(false);
941 myCurrentLineEdit = mySubMeshLine;
945 mySubMeshLine->setText("");
946 myCurrentLineEdit = 0;
948 setSelectionMode(myTypeId);
950 mySubMeshBtn->setEnabled(on);
951 mySubMeshLine->setEnabled(on);
955 //=================================================================================
956 // function : (onSelectGroup)
957 // purpose : Called when selection in 3D view or ObjectBrowser is changed
958 //=================================================================================
959 void SMESHGUI_GroupDlg::onSelectGroup(bool on)
962 if (mySelectSubMesh->isChecked()) {
963 mySelectSubMesh->setChecked(false);
965 myCurrentLineEdit = myGroupLine;
969 myGroupLine->setText("");
970 myCurrentLineEdit = 0;
972 setSelectionMode(myTypeId);
974 myGroupBtn->setEnabled(on);
975 myGroupLine->setEnabled(on);
979 //=================================================================================
980 // function : (onSelectGeomGroup)
981 // purpose : Called when selection in 3D view or ObjectBrowser is changed
982 //=================================================================================
983 void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
986 if (mySelectSubMesh->isChecked()) {
987 mySelectSubMesh->setChecked(false);
989 else if (mySelectGroup->isChecked()) {
990 mySelectGroup->setChecked(false);
992 myCurrentLineEdit = myGeomGroupLine;
996 myGeomGroupLine->setText("");
997 myCurrentLineEdit = 0;
999 setSelectionMode(myTypeId);
1004 //=================================================================================
1005 // function : setCurrentSelection()
1007 //=================================================================================
1008 void SMESHGUI_GroupDlg::setCurrentSelection()
1010 QPushButton* send = (QPushButton*)sender();
1011 myCurrentLineEdit = 0;
1012 if (send == myMeshGroupBtn) {
1013 myCurrentLineEdit = myMeshGroupLine;
1015 setSelectionMode(6);
1017 setSelectionMode(5);
1018 onObjectSelectionChanged();
1020 else if (send == mySubMeshBtn) {
1021 myCurrentLineEdit = mySubMeshLine;
1022 onObjectSelectionChanged();
1024 else if (send == myGroupBtn) {
1025 myCurrentLineEdit = myGroupLine;
1026 onObjectSelectionChanged();
1028 else if (send == myGeomGroupBtn) {
1029 myCurrentLineEdit = myGeomGroupLine;
1030 setSelectionMode(7);
1031 onObjectSelectionChanged();
1036 //=================================================================================
1037 // function : setFilters()
1038 // purpose : SLOT. Called when "Filter" button pressed.
1039 //=================================================================================
1040 void SMESHGUI_GroupDlg::setFilters()
1042 SMESH::ElementType aType = SMESH::ALL;
1045 case 0 : aType = SMESH::NODE; break;
1046 case 1 : aType = SMESH::EDGE; break;
1047 case 2 : aType = SMESH::FACE; break;
1048 case 3 : aType = SMESH::VOLUME; break;
1052 if ( myFilterDlg == 0 )
1054 myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, aType );
1055 connect( myFilterDlg, SIGNAL( Accepted() ), SLOT( onFilterAccepted() ) );
1058 myFilterDlg->Init( aType );
1060 myFilterDlg->SetSelection();
1061 myFilterDlg->SetMesh( myMesh );
1062 myFilterDlg->SetSourceWg( myElements );
1064 myFilterDlg->show();
1067 //=================================================================================
1068 // function : onFilterAccepted()
1069 // purpose : SLOT. Called when Filter dlg closed with OK button.
1070 // Uncheck "Select submesh" and "Select group" checkboxes
1071 //=================================================================================
1072 void SMESHGUI_GroupDlg::onFilterAccepted()
1074 if ( mySelectSubMesh->isChecked() || mySelectGroup->isChecked() )
1076 mySelectionMode = myTypeId;
1077 mySelectSubMesh->setChecked( false );
1078 mySelectGroup->setChecked( false );
1082 //=================================================================================
1083 // function : onAdd()
1085 //=================================================================================
1086 void SMESHGUI_GroupDlg::onAdd()
1088 SALOME_ListIO aList;
1089 mySelectionMgr->selectedObjects( aList );
1091 int aNbSel = aList.Extent();
1093 if (aNbSel == 0 || !myActor || myMesh->_is_nil()) return;
1097 SMESH::ElementType aType = SMESH::ALL;
1099 case 0: aType = SMESH::NODE; break;
1100 case 1: aType = SMESH::EDGE; break;
1101 case 2: aType = SMESH::FACE; break;
1102 case 3: aType = SMESH::VOLUME; break;
1105 if (myCurrentLineEdit == 0) {
1106 //if (aNbSel != 1) { myIsBusy = false; return; }
1107 QString aListStr = "";
1109 if (myTypeId == 0) {
1110 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
1113 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
1116 QStringList anElements = QStringList::split(" ", aListStr);
1117 QListBoxItem* anItem = 0;
1118 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
1119 anItem = myElements->findItem(*it, Qt::ExactMatch);
1121 anItem = new QListBoxText(*it);
1122 myElements->insertItem(anItem);
1124 myElements->setSelected(anItem, true);
1127 } else if (myCurrentLineEdit == mySubMeshLine) {
1128 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1130 SALOME_ListIO aList;
1131 mySelectionMgr->selectedObjects( aList );
1133 SALOME_ListIteratorOfListIO anIt (aList);
1134 for (; anIt.More(); anIt.Next()) {
1135 SMESH::SMESH_subMesh_var aSubMesh =
1136 SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1137 if (!aSubMesh->_is_nil()) {
1138 // check if mesh is the same
1139 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1141 SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
1142 int k = anElements->length();
1143 QListBoxItem* anItem = 0;
1144 for (int i = 0; i < k; i++) {
1145 QString aText = QString::number(anElements[i]);
1146 anItem = myElements->findItem(aText, Qt::ExactMatch);
1148 anItem = new QListBoxText(aText);
1149 myElements->insertItem(anItem);
1151 myElements->setSelected(anItem, true);
1154 catch (const SALOME::SALOME_Exception& ex) {
1155 SalomeApp_Tools::QtCatchCorbaException(ex);
1160 mySelectSubMesh->setChecked(false);
1162 onListSelectionChanged();
1164 } else if (myCurrentLineEdit == myGroupLine) {
1165 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1166 SALOME_ListIO aList;
1167 mySelectionMgr->selectedObjects( aList );
1169 SALOME_ListIteratorOfListIO anIt (aList);
1170 for (; anIt.More(); anIt.Next()) {
1171 SMESH::SMESH_Group_var aGroup =
1172 SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1173 if (!aGroup->_is_nil()) {
1174 // check if mesh is the same
1175 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1176 SMESH::long_array_var anElements = aGroup->GetListOfID();
1177 int k = anElements->length();
1178 QListBoxItem* anItem = 0;
1179 for (int i = 0; i < k; i++) {
1180 QString aText = QString::number(anElements[i]);
1181 anItem = myElements->findItem(aText, Qt::ExactMatch);
1183 anItem = new QListBoxText(aText);
1184 myElements->insertItem(anItem);
1186 myElements->setSelected(anItem, true);
1191 mySelectGroup->setChecked(false);
1193 onListSelectionChanged();
1195 } else if (myCurrentLineEdit == myGeomGroupLine && !CORBA::is_nil(myGeomGroup)) {
1196 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
1197 GEOM::GEOM_IGroupOperations_var aGroupOp =
1198 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
1200 SMESH::ElementType aGroupType = SMESH::ALL;
1201 switch(aGroupOp->GetType(myGeomGroup)) {
1202 case 7: aGroupType = SMESH::NODE; break;
1203 case 6: aGroupType = SMESH::EDGE; break;
1204 case 4: aGroupType = SMESH::FACE; break;
1205 case 2: aGroupType = SMESH::VOLUME; break;
1206 default: myIsBusy = false; return;
1209 if (aGroupType == aType) {
1210 _PTR(SObject) aGroupSO =
1211 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
1212 aStudy->FindObjectID(myGeomGroup->GetStudyEntry());
1214 SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
1215 SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
1216 SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom();;
1217 aBelongToGeom->SetGeom(myGeomGroup);
1218 aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str());
1219 aBelongToGeom->SetElementType(aType);
1220 aFilter->SetPredicate(aBelongToGeom);
1222 SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh);
1224 int k = anElements->length();
1225 QListBoxItem* anItem = 0;
1226 for (int i = 0; i < k; i++) {
1227 QString aText = QString::number(anElements[i]);
1228 anItem = myElements->findItem(aText, Qt::ExactMatch);
1230 anItem = new QListBoxText(aText);
1231 myElements->insertItem(anItem);
1233 myElements->setSelected(anItem, true);
1237 //VSR: mySelectGeomGroup->setChecked(false);
1239 onListSelectionChanged();
1242 // mySelectionMgr->clearSelected();
1246 //=================================================================================
1247 // function : onRemove()
1249 //=================================================================================
1250 void SMESHGUI_GroupDlg::onRemove()
1253 if (myCurrentLineEdit == 0) {
1254 for (int i = myElements->count(); i > 0; i--) {
1255 if (myElements->isSelected(i-1)) {
1256 myElements->removeItem(i-1);
1260 SALOME_ListIO aList;
1261 mySelectionMgr->selectedObjects( aList );
1263 int aNbSel = aList.Extent();
1265 if (aNbSel == 0) { myIsBusy = false; return; }
1267 SMESH::ElementType aType = SMESH::ALL;
1269 case 0: aType = SMESH::NODE; break;
1270 case 1: aType = SMESH::EDGE; break;
1271 case 2: aType = SMESH::FACE; break;
1272 case 3: aType = SMESH::VOLUME; break;
1275 if (myCurrentLineEdit == mySubMeshLine) {
1276 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1277 SALOME_ListIO aList;
1278 mySelectionMgr->selectedObjects( aList );
1280 SALOME_ListIteratorOfListIO anIt (aList);
1281 for (; anIt.More(); anIt.Next()) {
1282 SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1283 if (!aSubMesh->_is_nil()) {
1284 // check if mesh is the same
1285 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1286 if (aType == SMESH::NODE) {
1288 SMESH::long_array_var anElements = aSubMesh->GetNodesId();
1289 int k = anElements->length();
1290 QListBoxItem* anItem = 0;
1291 for (int i = 0; i < k; i++) {
1292 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1293 if (anItem) delete anItem;
1296 catch (const SALOME::SALOME_Exception& ex) {
1297 SalomeApp_Tools::QtCatchCorbaException(ex);
1302 SMESH::long_array_var anElements = aSubMesh->GetElementsId();
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;
1310 catch (const SALOME::SALOME_Exception& ex) {
1311 SalomeApp_Tools::QtCatchCorbaException(ex);
1318 else if (myCurrentLineEdit == myGroupLine) {
1319 Standard_Boolean aRes;
1320 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1321 SALOME_ListIO aList;
1322 mySelectionMgr->selectedObjects( aList );
1324 SALOME_ListIteratorOfListIO anIt (aList);
1325 for (; anIt.More(); anIt.Next()) {
1326 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1327 if (aRes && !aGroup->_is_nil()) {
1328 // check if mesh is the same
1329 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1330 SMESH::long_array_var anElements = aGroup->GetListOfID();
1331 int k = anElements->length();
1332 QListBoxItem* anItem = 0;
1333 for (int i = 0; i < k; i++) {
1334 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1335 if (anItem) delete anItem;
1346 //=================================================================================
1347 // function : onSort()
1349 //=================================================================================
1350 void SMESHGUI_GroupDlg::onSort()
1352 // PAL5412: sorts items in ascending by "string" value
1353 // myElements->sort(true);
1354 // myElements->update();
1355 int i, k = myElements->count();
1358 QStringList aSelected;
1359 std::vector<int> anArray(k);
1360 // QMemArray<int> anArray(k);
1361 QListBoxItem* anItem;
1363 for (anItem = myElements->firstItem(), i = 0; anItem != 0; anItem = anItem->next(), i++) {
1364 anArray[i] = anItem->text().toInt();
1365 if (anItem->isSelected())
1366 aSelected.append(anItem->text());
1368 // sort & update list
1369 std::sort(anArray.begin(), anArray.end());
1371 myElements->clear();
1372 for (i = 0; i < k; i++) {
1373 myElements->insertItem(QString::number(anArray[i]));
1375 for (QStringList::iterator it = aSelected.begin(); it != aSelected.end(); ++it) {
1376 anItem = myElements->findItem(*it, Qt::ExactMatch);
1377 if (anItem) myElements->setSelected(anItem, true);
1383 //=================================================================================
1384 // function : closeEvent()
1386 //=================================================================================
1387 void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*)
1392 //=================================================================================
1393 // function : SMESHGUI_GroupDlg::onClose
1394 // purpose : SLOT called when "Close" button pressed. Close dialog
1395 //=================================================================================
1396 void SMESHGUI_GroupDlg::onClose()
1398 if (SMESH::GetCurrentVtkView()) {
1399 SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
1400 SMESH::SetPointRepresentation(false);
1401 SMESH::SetPickable();
1404 mySelectionMgr->clearSelected();
1405 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1406 aViewWindow->SetSelectionMode(ActorSelection);
1407 mySelectionMgr->clearFilters();
1408 mySMESHGUI->ResetState();
1413 //=================================================================================
1414 // function : SMESHGUI_GroupDlg::onDeactivate
1415 // purpose : SLOT called when dialog must be deativated
1416 //=================================================================================
1417 void SMESHGUI_GroupDlg::onDeactivate()
1419 mySMESHGUI->ResetState();
1423 //=================================================================================
1424 // function : SMESHGUI_GroupDlg::enterEvent
1425 // purpose : Event filter
1426 //=================================================================================
1427 void SMESHGUI_GroupDlg::enterEvent (QEvent*)
1430 mySMESHGUI->EmitSignalDeactivateDialog();
1432 mySelectionMode = -1;
1433 setSelectionMode(myTypeId);
1434 //mySMESHGUI->SetActiveDialogBox((QDialog*)this);
1435 mySMESHGUI->SetActiveDialogBox(this);
1436 mySMESHGUI->SetState(800);
1440 //=================================================================================
1441 // function : hideEvent
1442 // purpose : caused by ESC key
1443 //=================================================================================
1444 void SMESHGUI_GroupDlg::hideEvent (QHideEvent*)