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 if (!theGroup->_is_nil())
131 mySelectSubMesh->setEnabled(false);
132 mySelectGroup->setEnabled(false);
135 mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
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 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
547 aViewWindow->SetSelectionMode(NodeSelection);
550 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
551 aViewWindow->SetSelectionMode(EdgeSelection);
554 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
555 aViewWindow->SetSelectionMode(FaceSelection);
558 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
559 aViewWindow->SetSelectionMode(VolumeSelection);
562 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
563 aViewWindow->SetSelectionMode(ActorSelection);
565 mySelectionMgr->installFilter(mySubMeshFilter);
566 else if (theMode == 5)
567 mySelectionMgr->installFilter(myGroupFilter);
568 else if (theMode == 6)
569 mySelectionMgr->installFilter(myMeshFilter);
571 mySelectionMode = theMode;
575 //=================================================================================
576 // function : onApply()
578 //=================================================================================
579 bool SMESHGUI_GroupDlg::onApply()
581 if (mySMESHGUI->isActiveStudyLocked())
584 if (myGrpTypeId == 0 &&
585 !myName->text().stripWhiteSpace().isEmpty() &&
586 myElements->count() > 0) {
587 mySelectionMgr->clearSelected();
588 if (myGroup->_is_nil()) {
589 SMESH::ElementType aType = SMESH::ALL;
591 case 0: aType = SMESH::NODE; break;
592 case 1: aType = SMESH::EDGE; break;
593 case 2: aType = SMESH::FACE; break;
594 case 3: aType = SMESH::VOLUME; break;
596 SMESH::long_array_var anIdList = new SMESH::long_array;
597 int i, k = myElements->count();
599 QListBoxItem* anItem;
600 for (i = 0, anItem = myElements->firstItem(); anItem != 0; i++, anItem = anItem->next()) {
601 anIdList[i] = anItem->text().toInt();
604 myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
605 myGroup->Add(anIdList.inout());
607 /* init for next operation */
610 myGroup = SMESH::SMESH_Group::_nil();
613 myGroup->SetName(myName->text());
615 QValueList<int> aAddList;
616 QValueList<int>::iterator anIt;
617 QListBoxItem* anItem;
619 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
620 int anId = anItem->text().toInt();
621 if ((anIt = myIdList.find(anId)) == myIdList.end())
622 aAddList.append(anId);
624 myIdList.remove(anIt);
626 if (!aAddList.empty()) {
627 SMESH::long_array_var anIdList = new SMESH::long_array;
628 anIdList->length(aAddList.count());
630 for (i = 0, anIt = aAddList.begin(); anIt != aAddList.end(); anIt++, i++)
632 myGroup->Add(anIdList.inout());
634 if (!myIdList.empty()) {
635 SMESH::long_array_var anIdList = new SMESH::long_array;
636 anIdList->length(myIdList.count());
638 for (i = 0, anIt = myIdList.begin(); anIt != myIdList.end(); anIt++, i++)
640 myGroup->Remove(anIdList.inout());
642 /* init for next operation */
644 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next())
645 myIdList.append(anItem->text().toInt());
648 mySMESHGUI->updateObjBrowser(true);
649 SMESH::UpdateView(); // asv: fix of BUG PAL5515
650 mySelectionMgr->clearSelected();
652 } else if (myGrpTypeId == 1 &&
653 !myName->text().stripWhiteSpace().isEmpty() &&
654 !CORBA::is_nil(myGeomGroup))
656 SMESH::ElementType aType = SMESH::ALL;
658 case 0: aType = SMESH::NODE; break;
659 case 1: aType = SMESH::EDGE; break;
660 case 2: aType = SMESH::FACE; break;
661 case 3: aType = SMESH::VOLUME; break;
664 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
665 GEOM::GEOM_IGroupOperations_var aGroupOp =
666 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
668 SMESH::SMESH_GroupOnGeom_var aGroupOnGeom =
669 myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomGroup);
671 mySMESHGUI->updateObjBrowser(true);
672 mySelectionMgr->clearSelected();
673 /* init for next operation */
681 //=================================================================================
684 //=================================================================================
685 void SMESHGUI_GroupDlg::onOK()
691 //=================================================================================
692 // function : onListSelectionChanged()
693 // purpose : Called when selection in element list is changed
694 //=================================================================================
695 void SMESHGUI_GroupDlg::onListSelectionChanged()
697 // MESSAGE("SMESHGUI_GroupDlg::onListSelectionChanged(); myActor = " << myActor);
698 if( myIsBusy || !myActor) return;
701 if (myCurrentLineEdit == 0) {
702 mySelectionMgr->clearSelected();
703 TColStd_MapOfInteger aIndexes;
704 QListBoxItem* anItem;
705 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
706 if (anItem->isSelected()) {
707 int anId = anItem->text().toInt();
711 mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
713 aList.Append(myActor->getIO());
714 mySelectionMgr->setSelectedObjects(aList,false);
715 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
716 aViewWindow->highlight( myActor->getIO(), true, true );
721 //=================================================================================
722 // function : onObjectSelectionChanged()
723 // purpose : Called when selection in 3D view or ObjectBrowser is changed
724 //=================================================================================
725 void SMESHGUI_GroupDlg::onObjectSelectionChanged()
727 if ( myIsBusy || !isEnabled()) return;
731 mySelectionMgr->selectedObjects( aList );
733 int aNbSel = aList.Extent();
734 myElements->clearSelection();
736 if (myCurrentLineEdit) {
737 myCurrentLineEdit->setText("");
738 QString aString = "";
740 if (myCurrentLineEdit == myMeshGroupLine) {
741 mySelectSubMesh->setEnabled(false);
742 mySelectGroup->setEnabled(false);
743 myGroupLine->setText("");
744 mySubMeshLine->setText("");
746 myGeomGroupBtn->setEnabled(false);
747 myGeomGroupLine->setEnabled(false);
748 myGeomGroupLine->setText("");
755 myGroup = SMESH::SMESH_Group::_nil();
756 myMesh = SMESH::SMESH_Mesh::_nil();
760 Handle(SALOME_InteractiveObject) IO = aList.First();
763 myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
764 if (myMesh->_is_nil())
769 myGroup = SMESH::SMESH_Group::_nil();
771 myActor = SMESH::FindActorByObject(myMesh);
772 SMESH::SetPickable(myActor);
774 aString = aList.First()->getName();
775 myMeshGroupLine->setText(aString) ;
776 myMeshGroupLine->home( false );
778 mySelectSubMesh->setEnabled(true);
779 mySelectGroup->setEnabled(true);
780 myGeomGroupBtn->setEnabled(true);
781 myGeomGroupLine->setEnabled(true);
784 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(IO);
785 if (aGroup->_is_nil())
791 myCurrentLineEdit = 0;
794 mySelectSubMesh->setEnabled(true);
795 mySelectGroup->setEnabled(true);
796 myGeomGroupBtn->setEnabled(true);
797 myGeomGroupLine->setEnabled(true);
799 myCurrentLineEdit = 0;
808 setSelectionMode(myTypeId);
814 } else if (myCurrentLineEdit == myGeomGroupLine) {
816 myGeomGroup = GEOM::GEOM_Object::_nil();
821 Standard_Boolean testResult = Standard_False;
822 myGeomGroup = GEOMBase::ConvertIOinGEOMObject(aList.First(), testResult);
824 // Check if the object is a geometry group
825 if (!testResult || CORBA::is_nil(myGeomGroup)) {
826 myGeomGroup = GEOM::GEOM_Object::_nil();
830 // Check if group constructed on the same shape as a mesh or on its child
831 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
832 GEOM::GEOM_IGroupOperations_var anOp =
833 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
835 // The main shape of the group
836 GEOM::GEOM_Object_var aGroupMainShape;
837 if (myGeomGroup->GetType() == 37)
838 aGroupMainShape = anOp->GetMainShape(myGeomGroup);
840 aGroupMainShape = GEOM::GEOM_Object::_duplicate(myGeomGroup);
841 _PTR(SObject) aGroupMainShapeSO =
842 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
843 aStudy->FindObjectIOR(aGroupMainShape->GetStudyEntry());
846 _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
848 myGeomGroup = GEOM::GEOM_Object::_nil();
852 _PTR(SObject) anObj, aRef;
853 bool isRefOrSubShape = false;
854 if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) {
855 //if (strcmp(aRef->GetID(), aGroupMainShapeSO->GetID()) == 0) {
856 if (aRef->GetID() == aGroupMainShapeSO->GetID()) {
857 isRefOrSubShape = true;
859 _PTR(SObject) aFather = aGroupMainShapeSO->GetFather();
860 _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent();
861 //while (!isRefOrSubShape && strcmp(aFather->GetID(), aComponent->GetID()) != 0) {
862 while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) {
863 //if (strcmp(aRef->GetID(), aFather->GetID()) == 0)
864 if (aRef->GetID() == aFather->GetID())
865 isRefOrSubShape = true;
867 aFather = aFather->GetFather();
871 if (!isRefOrSubShape) {
872 myGeomGroup = GEOM::GEOM_Object::_nil();
880 if(myCurrentLineEdit == mySubMeshLine)
881 aString = tr("SMESH_SUBMESH_SELECTED").arg(aNbSel);
882 else if(myCurrentLineEdit == myGroupLine || myCurrentLineEdit == myGeomGroupLine)
883 aString = tr("SMESH_GROUP_SELECTED").arg(aNbSel);
885 aString = aList.First()->getName();
889 myCurrentLineEdit->setText(aString);
890 myCurrentLineEdit->home(false);
895 if (aNbSel == 1 && myActor ) {
896 QString aListStr = "";
899 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
901 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
904 QStringList anElements = QStringList::split(" ", aListStr);
905 QListBoxItem* anItem = 0;
906 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
907 anItem = myElements->findItem(*it, Qt::ExactMatch);
908 if (anItem) myElements->setSelected(anItem, true);
915 if (!myGroup->_is_nil())
916 myActor = SMESH::FindActorByObject(myGroup);
918 myActor = SMESH::FindActorByObject(myMesh);
924 //=================================================================================
925 // function : onSelectSubMesh()
926 // purpose : Called when selection in 3D view or ObjectBrowser is changed
927 //=================================================================================
928 void SMESHGUI_GroupDlg::onSelectSubMesh(bool on)
931 if (mySelectGroup->isChecked()) {
932 mySelectGroup->setChecked(false);
934 //VSR: else if (mySelectGeomGroup->isChecked()) {
935 //VSR: mySelectGeomGroup->setChecked(false);
937 myCurrentLineEdit = mySubMeshLine;
941 mySubMeshLine->setText("");
942 myCurrentLineEdit = 0;
944 setSelectionMode(myTypeId);
946 mySubMeshBtn->setEnabled(on);
947 mySubMeshLine->setEnabled(on);
951 //=================================================================================
952 // function : (onSelectGroup)
953 // purpose : Called when selection in 3D view or ObjectBrowser is changed
954 //=================================================================================
955 void SMESHGUI_GroupDlg::onSelectGroup(bool on)
958 if (mySelectSubMesh->isChecked()) {
959 mySelectSubMesh->setChecked(false);
961 myCurrentLineEdit = myGroupLine;
965 myGroupLine->setText("");
966 myCurrentLineEdit = 0;
968 setSelectionMode(myTypeId);
970 myGroupBtn->setEnabled(on);
971 myGroupLine->setEnabled(on);
975 //=================================================================================
976 // function : (onSelectGeomGroup)
977 // purpose : Called when selection in 3D view or ObjectBrowser is changed
978 //=================================================================================
979 void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
982 if (mySelectSubMesh->isChecked()) {
983 mySelectSubMesh->setChecked(false);
985 else if (mySelectGroup->isChecked()) {
986 mySelectGroup->setChecked(false);
988 myCurrentLineEdit = myGeomGroupLine;
992 myGeomGroupLine->setText("");
993 myCurrentLineEdit = 0;
995 setSelectionMode(myTypeId);
1000 //=================================================================================
1001 // function : setCurrentSelection()
1003 //=================================================================================
1004 void SMESHGUI_GroupDlg::setCurrentSelection()
1006 QPushButton* send = (QPushButton*)sender();
1007 myCurrentLineEdit = 0;
1008 if (send == myMeshGroupBtn) {
1009 myCurrentLineEdit = myMeshGroupLine;
1011 setSelectionMode(6);
1013 setSelectionMode(5);
1014 onObjectSelectionChanged();
1016 else if (send == mySubMeshBtn) {
1017 myCurrentLineEdit = mySubMeshLine;
1018 onObjectSelectionChanged();
1020 else if (send == myGroupBtn) {
1021 myCurrentLineEdit = myGroupLine;
1022 onObjectSelectionChanged();
1024 else if (send == myGeomGroupBtn) {
1025 myCurrentLineEdit = myGeomGroupLine;
1026 setSelectionMode(7);
1027 onObjectSelectionChanged();
1032 //=================================================================================
1033 // function : setFilters()
1034 // purpose : SLOT. Called when "Filter" button pressed.
1035 //=================================================================================
1036 void SMESHGUI_GroupDlg::setFilters()
1038 SMESH::ElementType aType = SMESH::ALL;
1041 case 0 : aType = SMESH::NODE; break;
1042 case 1 : aType = SMESH::EDGE; break;
1043 case 2 : aType = SMESH::FACE; break;
1044 case 3 : aType = SMESH::VOLUME; break;
1048 if ( myFilterDlg == 0 )
1050 myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, aType );
1051 connect( myFilterDlg, SIGNAL( Accepted() ), SLOT( onFilterAccepted() ) );
1054 myFilterDlg->Init( aType );
1056 myFilterDlg->SetSelection();
1057 myFilterDlg->SetMesh( myMesh );
1058 myFilterDlg->SetSourceWg( myElements );
1060 myFilterDlg->show();
1063 //=================================================================================
1064 // function : onFilterAccepted()
1065 // purpose : SLOT. Called when Filter dlg closed with OK button.
1066 // Uncheck "Select submesh" and "Select group" checkboxes
1067 //=================================================================================
1068 void SMESHGUI_GroupDlg::onFilterAccepted()
1070 if ( mySelectSubMesh->isChecked() || mySelectGroup->isChecked() )
1072 mySelectionMode = myTypeId;
1073 mySelectSubMesh->setChecked( false );
1074 mySelectGroup->setChecked( false );
1078 //=================================================================================
1079 // function : onAdd()
1081 //=================================================================================
1082 void SMESHGUI_GroupDlg::onAdd()
1084 SALOME_ListIO aList;
1085 mySelectionMgr->selectedObjects( aList );
1087 int aNbSel = aList.Extent();
1089 if (aNbSel == 0 || !myActor || myMesh->_is_nil()) return;
1093 SMESH::ElementType aType = SMESH::ALL;
1095 case 0: aType = SMESH::NODE; break;
1096 case 1: aType = SMESH::EDGE; break;
1097 case 2: aType = SMESH::FACE; break;
1098 case 3: aType = SMESH::VOLUME; break;
1101 if (myCurrentLineEdit == 0) {
1102 //if (aNbSel != 1) { myIsBusy = false; return; }
1103 QString aListStr = "";
1105 if (myTypeId == 0) {
1106 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
1109 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
1112 QStringList anElements = QStringList::split(" ", aListStr);
1113 QListBoxItem* anItem = 0;
1114 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
1115 anItem = myElements->findItem(*it, Qt::ExactMatch);
1117 anItem = new QListBoxText(*it);
1118 myElements->insertItem(anItem);
1120 myElements->setSelected(anItem, true);
1123 } else if (myCurrentLineEdit == mySubMeshLine) {
1124 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1126 SALOME_ListIO aList;
1127 mySelectionMgr->selectedObjects( aList );
1129 SALOME_ListIteratorOfListIO anIt (aList);
1130 for (; anIt.More(); anIt.Next()) {
1131 SMESH::SMESH_subMesh_var aSubMesh =
1132 SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1133 if (!aSubMesh->_is_nil()) {
1134 // check if mesh is the same
1135 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1137 SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
1138 int k = anElements->length();
1139 QListBoxItem* anItem = 0;
1140 for (int i = 0; i < k; i++) {
1141 QString aText = QString::number(anElements[i]);
1142 anItem = myElements->findItem(aText, Qt::ExactMatch);
1144 anItem = new QListBoxText(aText);
1145 myElements->insertItem(anItem);
1147 myElements->setSelected(anItem, true);
1150 catch (const SALOME::SALOME_Exception& ex) {
1151 SalomeApp_Tools::QtCatchCorbaException(ex);
1156 mySelectSubMesh->setChecked(false);
1158 onListSelectionChanged();
1160 } else if (myCurrentLineEdit == myGroupLine) {
1161 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1162 SALOME_ListIO aList;
1163 mySelectionMgr->selectedObjects( aList );
1165 SALOME_ListIteratorOfListIO anIt (aList);
1166 for (; anIt.More(); anIt.Next()) {
1167 SMESH::SMESH_Group_var aGroup =
1168 SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1169 if (!aGroup->_is_nil()) {
1170 // check if mesh is the same
1171 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1172 SMESH::long_array_var anElements = aGroup->GetListOfID();
1173 int k = anElements->length();
1174 QListBoxItem* anItem = 0;
1175 for (int i = 0; i < k; i++) {
1176 QString aText = QString::number(anElements[i]);
1177 anItem = myElements->findItem(aText, Qt::ExactMatch);
1179 anItem = new QListBoxText(aText);
1180 myElements->insertItem(anItem);
1182 myElements->setSelected(anItem, true);
1187 mySelectGroup->setChecked(false);
1189 onListSelectionChanged();
1191 } else if (myCurrentLineEdit == myGeomGroupLine && !CORBA::is_nil(myGeomGroup)) {
1192 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
1193 GEOM::GEOM_IGroupOperations_var aGroupOp =
1194 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
1196 SMESH::ElementType aGroupType = SMESH::ALL;
1197 switch(aGroupOp->GetType(myGeomGroup)) {
1198 case 7: aGroupType = SMESH::NODE; break;
1199 case 6: aGroupType = SMESH::EDGE; break;
1200 case 4: aGroupType = SMESH::FACE; break;
1201 case 2: aGroupType = SMESH::VOLUME; break;
1202 default: myIsBusy = false; return;
1205 if (aGroupType == aType) {
1206 _PTR(SObject) aGroupSO =
1207 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
1208 aStudy->FindObjectIOR(myGeomGroup->GetStudyEntry());
1210 SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
1211 SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
1212 SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom();;
1213 aBelongToGeom->SetGeom(myGeomGroup);
1214 aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str());
1215 aBelongToGeom->SetElementType(aType);
1216 aFilter->SetPredicate(aBelongToGeom);
1218 SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh);
1220 int k = anElements->length();
1221 QListBoxItem* anItem = 0;
1222 for (int i = 0; i < k; i++) {
1223 QString aText = QString::number(anElements[i]);
1224 anItem = myElements->findItem(aText, Qt::ExactMatch);
1226 anItem = new QListBoxText(aText);
1227 myElements->insertItem(anItem);
1229 myElements->setSelected(anItem, true);
1233 //VSR: mySelectGeomGroup->setChecked(false);
1235 onListSelectionChanged();
1238 // mySelectionMgr->clearSelected();
1242 //=================================================================================
1243 // function : onRemove()
1245 //=================================================================================
1246 void SMESHGUI_GroupDlg::onRemove()
1249 if (myCurrentLineEdit == 0) {
1250 for (int i = myElements->count(); i > 0; i--) {
1251 if (myElements->isSelected(i-1)) {
1252 myElements->removeItem(i-1);
1256 SALOME_ListIO aList;
1257 mySelectionMgr->selectedObjects( aList );
1259 int aNbSel = aList.Extent();
1261 if (aNbSel == 0) { myIsBusy = false; return; }
1263 SMESH::ElementType aType = SMESH::ALL;
1265 case 0: aType = SMESH::NODE; break;
1266 case 1: aType = SMESH::EDGE; break;
1267 case 2: aType = SMESH::FACE; break;
1268 case 3: aType = SMESH::VOLUME; break;
1271 if (myCurrentLineEdit == mySubMeshLine) {
1272 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1273 SALOME_ListIO aList;
1274 mySelectionMgr->selectedObjects( aList );
1276 SALOME_ListIteratorOfListIO anIt (aList);
1277 for (; anIt.More(); anIt.Next()) {
1278 SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1279 if (!aSubMesh->_is_nil()) {
1280 // check if mesh is the same
1281 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1282 if (aType == SMESH::NODE) {
1284 SMESH::long_array_var anElements = aSubMesh->GetNodesId();
1285 int k = anElements->length();
1286 QListBoxItem* anItem = 0;
1287 for (int i = 0; i < k; i++) {
1288 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1289 if (anItem) delete anItem;
1292 catch (const SALOME::SALOME_Exception& ex) {
1293 SalomeApp_Tools::QtCatchCorbaException(ex);
1298 SMESH::long_array_var anElements = aSubMesh->GetElementsId();
1299 int k = anElements->length();
1300 QListBoxItem* anItem = 0;
1301 for (int i = 0; i < k; i++) {
1302 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1303 if (anItem) delete anItem;
1306 catch (const SALOME::SALOME_Exception& ex) {
1307 SalomeApp_Tools::QtCatchCorbaException(ex);
1314 else if (myCurrentLineEdit == myGroupLine) {
1315 Standard_Boolean aRes;
1316 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1317 SALOME_ListIO aList;
1318 mySelectionMgr->selectedObjects( aList );
1320 SALOME_ListIteratorOfListIO anIt (aList);
1321 for (; anIt.More(); anIt.Next()) {
1322 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1323 if (aRes && !aGroup->_is_nil()) {
1324 // check if mesh is the same
1325 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1326 SMESH::long_array_var anElements = aGroup->GetListOfID();
1327 int k = anElements->length();
1328 QListBoxItem* anItem = 0;
1329 for (int i = 0; i < k; i++) {
1330 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1331 if (anItem) delete anItem;
1342 //=================================================================================
1343 // function : onSort()
1345 //=================================================================================
1346 void SMESHGUI_GroupDlg::onSort()
1348 // PAL5412: sorts items in ascending by "string" value
1349 // myElements->sort(true);
1350 // myElements->update();
1351 int i, k = myElements->count();
1354 QStringList aSelected;
1355 std::vector<int> anArray(k);
1356 // QMemArray<int> anArray(k);
1357 QListBoxItem* anItem;
1359 for (anItem = myElements->firstItem(), i = 0; anItem != 0; anItem = anItem->next(), i++) {
1360 anArray[i] = anItem->text().toInt();
1361 if (anItem->isSelected())
1362 aSelected.append(anItem->text());
1364 // sort & update list
1365 std::sort(anArray.begin(), anArray.end());
1367 myElements->clear();
1368 for (i = 0; i < k; i++) {
1369 myElements->insertItem(QString::number(anArray[i]));
1371 for (QStringList::iterator it = aSelected.begin(); it != aSelected.end(); ++it) {
1372 anItem = myElements->findItem(*it, Qt::ExactMatch);
1373 if (anItem) myElements->setSelected(anItem, true);
1379 //=================================================================================
1380 // function : closeEvent()
1382 //=================================================================================
1383 void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*)
1388 //=================================================================================
1389 // function : SMESHGUI_GroupDlg::onClose
1390 // purpose : SLOT called when "Close" button pressed. Close dialog
1391 //=================================================================================
1392 void SMESHGUI_GroupDlg::onClose()
1394 if (SMESH::GetCurrentVtkView()) {
1395 SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
1396 SMESH::SetPointRepresentation(false);
1397 SMESH::SetPickable();
1400 mySelectionMgr->clearSelected();
1401 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1402 aViewWindow->SetSelectionMode(ActorSelection);
1403 mySelectionMgr->clearFilters();
1404 mySMESHGUI->ResetState();
1409 //=================================================================================
1410 // function : SMESHGUI_GroupDlg::onDeactivate
1411 // purpose : SLOT called when dialog must be deativated
1412 //=================================================================================
1413 void SMESHGUI_GroupDlg::onDeactivate()
1415 mySMESHGUI->ResetState();
1419 //=================================================================================
1420 // function : SMESHGUI_GroupDlg::enterEvent
1421 // purpose : Event filter
1422 //=================================================================================
1423 void SMESHGUI_GroupDlg::enterEvent (QEvent*)
1426 mySMESHGUI->EmitSignalDeactivateDialog();
1428 mySelectionMode = -1;
1429 setSelectionMode(myTypeId);
1430 //mySMESHGUI->SetActiveDialogBox((QDialog*)this);
1431 mySMESHGUI->SetActiveDialogBox(this);
1432 mySMESHGUI->SetState(800);
1436 //=================================================================================
1437 // function : hideEvent
1438 // purpose : caused by ESC key
1439 //=================================================================================
1440 void SMESHGUI_GroupDlg::hideEvent (QHideEvent*)