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);
138 /* Move widget on the botton right corner of main widget */
140 mySMESHGUI->DefineDlgPosition(this, x, y);
144 //=================================================================================
145 // function : SMESHGUI_GroupDlg()
147 //=================================================================================
148 void SMESHGUI_GroupDlg::initDialog(bool create)
152 myCurrentLineEdit = 0;
154 QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
157 setCaption(tr("SMESH_CREATE_GROUP_TITLE"));
159 setCaption(tr("SMESH_EDIT_GROUP_TITLE"));
161 setSizeGripEnabled(TRUE);
163 QGridLayout* aMainLayout = new QGridLayout(this, 7, 3, 11, 6);
165 /***************************************************************/
166 QLabel* meshGroupLab = new QLabel(this, "mesh/group label");
168 meshGroupLab->setText(tr("SMESH_MESH"));
170 meshGroupLab->setText(tr("SMESH_GROUP"));
171 myMeshGroupBtn = new QPushButton(this, "mesh/group button");
172 myMeshGroupBtn->setPixmap(image0);
173 myMeshGroupLine = new QLineEdit(this, "mesh/group line");
174 myMeshGroupLine->setReadOnly(true);
176 /***************************************************************/
177 myTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Group types");
178 myTypeGroup->setTitle(tr("SMESH_ELEMENTS_TYPE"));
179 myTypeGroup->setExclusive(true);
182 types.append(tr("MESH_NODE"));
183 types.append(tr("SMESH_EDGE"));
184 types.append(tr("SMESH_FACE"));
185 types.append(tr("SMESH_VOLUME"));
187 for (int i = 0; i < types.count(); i++) {
188 rb = new QRadioButton(types[i], myTypeGroup);
190 myTypeGroup->setEnabled(create);
193 /***************************************************************/
194 QLabel* aName = new QLabel(this, "name label");
195 aName->setText(tr("SMESH_NAME"));
196 aName->setMinimumSize(50,0);
197 myName = new QLineEdit(this, "name");
199 /***************************************************************/
200 myGrpTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Type of group");
201 myGrpTypeGroup->setTitle(tr("SMESH_GROUP_TYPE"));
202 myGrpTypeGroup->setExclusive(true);
203 QRadioButton* rb1 = new QRadioButton( tr("SMESH_GROUP_STANDALONE"), myGrpTypeGroup);
204 QRadioButton* rb2 = new QRadioButton( tr("SMESH_GROUP_GEOMETRY"), myGrpTypeGroup);
205 myGrpTypeGroup->setEnabled(create);
208 /***************************************************************/
209 myWGStack = new QWidgetStack( this, "widget stack");
210 QWidget* wg1 = new QFrame( myWGStack, "first widget" );
211 QWidget* wg2 = new QFrame( myWGStack, "second widget" );
213 /***************************************************************/
214 QGroupBox* aContentBox = new QGroupBox(1, Qt::Horizontal, wg1, "content box");
215 aContentBox->setTitle(tr("SMESH_CONTENT"));
216 QFrame* aContent = new QFrame(aContentBox, "content");
217 QGridLayout* aLayout = new QGridLayout(aContent, 7, 4);
218 aLayout->setSpacing(6);
219 aLayout->setAutoAdd(false);
221 QLabel* aLabel = new QLabel(aContent, "elements label");
222 aLabel->setText(tr("SMESH_ID_ELEMENTS"));
223 myElements = new QListBox(aContent, "elements list");
224 myElements->setSelectionMode(QListBox::Extended);
226 myFilter = new QPushButton(aContent, "filter");
227 myFilter->setText(tr("SMESH_BUT_FILTER"));
228 QPushButton* aAddBtn = new QPushButton(aContent, "add");
229 aAddBtn->setText(tr("SMESH_BUT_ADD"));
230 QPushButton* aRemoveBtn = new QPushButton(aContent, "remove");
231 aRemoveBtn->setText(tr("SMESH_BUT_REMOVE"));
232 QPushButton* aSortBtn = new QPushButton(aContent, "sort");
233 aSortBtn->setText(tr("SMESH_BUT_SORT"));
235 aLayout->addWidget(aLabel, 0, 0);
236 aLayout->addMultiCellWidget(myElements, 1, 6, 0, 0);
237 aLayout->addWidget(myFilter, 1, 2);
238 aLayout->addWidget(aAddBtn, 3, 2);
239 aLayout->addWidget(aRemoveBtn, 4, 2);
240 aLayout->addWidget(aSortBtn, 6, 2);
242 aLayout->setColStretch(0, 1);
243 aLayout->addColSpacing(1, 20);
244 aLayout->addColSpacing(3, 20);
245 aLayout->setRowStretch(2, 1);
246 aLayout->setRowStretch(5, 1);
248 /***************************************************************/
249 QGroupBox* aSelectBox = new QGroupBox(3, Qt::Horizontal, wg1, "select box");
250 aSelectBox->setTitle(tr("SMESH_SELECT_FROM"));
252 mySelectSubMesh = new QCheckBox(aSelectBox, "submesh checkbox");
253 mySelectSubMesh->setText(tr("SMESH_SUBMESH"));
254 mySelectSubMesh->setMinimumSize(50, 0);
255 mySubMeshBtn = new QPushButton(aSelectBox, "submesh button");
256 mySubMeshBtn->setText("");
257 mySubMeshBtn->setPixmap(image0);
258 mySubMeshLine = new QLineEdit(aSelectBox, "submesh line");
259 mySubMeshLine->setReadOnly(true);
260 onSelectSubMesh(false);
262 mySelectGroup = new QCheckBox(aSelectBox, "group checkbox");
263 mySelectGroup->setText(tr("SMESH_GROUP"));
264 mySelectGroup->setMinimumSize(50, 0);
265 myGroupBtn = new QPushButton(aSelectBox, "group button");
266 myGroupBtn->setText("");
267 myGroupBtn->setPixmap(image0);
268 myGroupLine = new QLineEdit(aSelectBox, "group line");
269 myGroupLine->setReadOnly(true);
270 onSelectGroup(false);
272 /***************************************************************/
273 QGridLayout* wg1Layout = new QGridLayout( wg1, 3, 1, 0, 6 );
274 wg1Layout->addWidget(aContentBox, 0, 0);
275 wg1Layout->addWidget(aSelectBox, 1, 0);
276 wg1Layout->setRowStretch(2, 5);
278 /***************************************************************/
279 QLabel* geomObject = new QLabel(wg2, "geometry object label");
280 geomObject->setText(tr("SMESH_OBJECT_GEOM"));
281 myGeomGroupBtn = new QPushButton(wg2, "geometry group button");
282 myGeomGroupBtn->setText("");
283 myGeomGroupBtn->setPixmap(image0);
284 myGeomGroupLine = new QLineEdit(wg2, "geometry group line");
285 myGeomGroupLine->setReadOnly(true); //VSR ???
286 onSelectGeomGroup(false);
288 /***************************************************************/
289 QGridLayout* wg2Layout = new QGridLayout( wg2, 2, 3, 0, 6 );
290 wg2Layout->addWidget(geomObject, 0, 0);
291 wg2Layout->addWidget(myGeomGroupBtn, 0, 1);
292 wg2Layout->addWidget(myGeomGroupLine,0, 2);
293 wg2Layout->setRowStretch(1, 5);
295 /***************************************************************/
296 QVBoxLayout* dumb = new QVBoxLayout(myWGStack);
297 dumb->addWidget(wg1);
298 dumb->addWidget(wg2);
299 myWGStack->addWidget( wg1, myGrpTypeGroup->id(rb1) );
300 myWGStack->addWidget( wg2, myGrpTypeGroup->id(rb2) );
302 /***************************************************************/
303 QFrame* aButtons = new QFrame(this, "button box");
304 aButtons->setFrameStyle(QFrame::Box | QFrame::Sunken);
305 QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons, 11, 6);
306 aBtnLayout->setAutoAdd(false);
308 QPushButton* aOKBtn = new QPushButton(aButtons, "ok");
309 aOKBtn->setText(tr("SMESH_BUT_OK"));
310 aOKBtn->setAutoDefault(true);
311 aOKBtn->setDefault(true);
312 QPushButton* aApplyBtn = new QPushButton(aButtons, "apply");
313 aApplyBtn->setText(tr("SMESH_BUT_APPLY"));
314 aApplyBtn->setAutoDefault(true);
315 QPushButton* aCloseBtn = new QPushButton(aButtons, "close");
316 aCloseBtn->setText(tr("SMESH_BUT_CLOSE"));
317 aCloseBtn->setAutoDefault(true);
319 aBtnLayout->addWidget(aOKBtn);
320 aBtnLayout->addWidget(aApplyBtn);
321 aBtnLayout->addStretch();
322 aBtnLayout->addWidget(aCloseBtn);
324 /***************************************************************/
325 aMainLayout->addWidget(meshGroupLab, 0, 0);
326 aMainLayout->addWidget(myMeshGroupBtn, 0, 1);
327 aMainLayout->addWidget(myMeshGroupLine, 0, 2);
328 aMainLayout->addMultiCellWidget(myTypeGroup, 1, 1, 0, 2);
329 aMainLayout->addWidget(aName, 2, 0);
330 aMainLayout->addWidget(myName, 2, 2);
331 aMainLayout->addMultiCellWidget(myGrpTypeGroup, 3, 3, 0, 2);
332 aMainLayout->addMultiCellWidget(myWGStack, 4, 4, 0, 2);
333 aMainLayout->setRowStretch( 5, 5 );
334 aMainLayout->addMultiCellWidget(aButtons, 6, 6, 0, 2);
336 /* signals and slots connections */
337 connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
339 connect(myGrpTypeGroup, SIGNAL(clicked(int)), this, SLOT(onGrpTypeChanged(int)));
341 connect(myTypeGroup, SIGNAL(clicked(int)), this, SLOT(onTypeChanged(int)));
343 connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
344 connect(myElements, SIGNAL(selectionChanged()), this, SLOT(onListSelectionChanged()));
346 connect(myFilter, SIGNAL(clicked()), this, SLOT(setFilters()));
347 connect(aAddBtn, SIGNAL(clicked()), this, SLOT(onAdd()));
348 connect(aRemoveBtn, SIGNAL(clicked()), this, SLOT(onRemove()));
349 connect(aSortBtn, SIGNAL(clicked()), this, SLOT(onSort()));
351 connect(mySelectSubMesh, SIGNAL(toggled(bool)), this, SLOT(onSelectSubMesh(bool)));
352 connect(mySelectGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool)));
353 connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
354 connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
355 connect(myGeomGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
357 connect(aOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
358 connect(aApplyBtn, SIGNAL(clicked()), this, SLOT(onApply()));
359 connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(onClose()));
362 mySMESHGUI->SetActiveDialogBox(this);
363 mySMESHGUI->SetState(800);
365 mySelectionMode = -1;
366 myMeshFilter = new SMESH_TypeFilter(MESH);
367 mySubMeshFilter = new SMESH_TypeFilter(SUBMESH);
368 myGroupFilter = new SMESH_TypeFilter(GROUP);
370 connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
371 connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onClose()));
372 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged()));
374 myGrpTypeGroup->setButton(myGrpTypeGroup->id(rb1)); // VSR !!!
375 onGrpTypeChanged(myGrpTypeGroup->id(rb1)); // VSR!!!
377 if (myMesh->_is_nil() )
378 myTypeGroup->setButton(0);
383 //=================================================================================
384 // function : ~SMESHGUI_GroupDlg()
385 // purpose : Destroys the object and frees any allocated resources
386 //=================================================================================
387 SMESHGUI_GroupDlg::~SMESHGUI_GroupDlg()
389 // no need to delete child widgets, Qt does it all for us
390 if ( myFilterDlg != 0 )
392 myFilterDlg->reparent( 0, QPoint() );
397 //=================================================================================
400 //=================================================================================
401 void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
403 mySelectionMgr->installFilter(myMeshFilter);
405 /* init data from current selection */
406 myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
407 myGroup = SMESH::SMESH_Group::_nil();
409 myActor = SMESH::FindActorByObject(myMesh);
410 SMESH::SetPickable(myActor);
413 mySelectionMgr->selectedObjects( aList );
414 if( !aList.IsEmpty() )
416 QString aName = aList.First()->getName();
417 myMeshGroupLine->setText(aName) ;
418 myMeshGroupLine->home( false );
421 myCurrentLineEdit = 0;
423 myTypeGroup->setButton(0);
427 //=================================================================================
430 //=================================================================================
431 void SMESHGUI_GroupDlg::init (SMESH::SMESH_Group_ptr theGroup)
433 myMesh = theGroup->GetMesh();
434 myGroup = SMESH::SMESH_Group::_duplicate(theGroup);
436 myActor = SMESH::FindActorByObject(myMesh);
438 myActor = SMESH::FindActorByObject(myGroup);
439 SMESH::SetPickable(myActor);
442 switch(theGroup->GetType()) {
443 case SMESH::NODE: aType= 0; break;
444 case SMESH::EDGE: aType = 1; break;
445 case SMESH::FACE: aType = 2; break;
446 case SMESH::VOLUME: aType = 3; break;
449 myName->setText(myGroup->GetName());
451 myMeshGroupLine->setText(myGroup->GetName());
453 myCurrentLineEdit = 0;
454 myTypeGroup->setButton(aType);
456 setSelectionMode(aType);
460 if (!theGroup->IsEmpty()) {
461 SMESH::long_array_var anElements = myGroup->GetListOfID();
462 int k = anElements->length();
463 for (int i = 0; i < k; i++) {
464 myIdList.append(anElements[i]);
465 myElements->insertItem(QString::number(anElements[i]));
467 myElements->selectAll(true);
471 //=================================================================================
472 // function : updateButtons()
474 //=================================================================================
475 void SMESHGUI_GroupDlg::updateButtons()
479 if (myGrpTypeId == 0)
480 enable = !myName->text().stripWhiteSpace().isEmpty() && myElements->count() > 0;
481 else if (myGrpTypeId == 1)
482 enable = !myName->text().stripWhiteSpace().isEmpty() && !CORBA::is_nil( myGeomGroup );
484 aBtn = (QPushButton*) child("ok", "QPushButton");
485 if (aBtn) aBtn->setEnabled(enable);
486 aBtn = (QPushButton*) child("apply", "QPushButton");
487 if (aBtn) aBtn->setEnabled(enable);
490 //=================================================================================
491 // function : onNameChanged()
493 //=================================================================================
494 void SMESHGUI_GroupDlg::onNameChanged (const QString& text)
499 //=================================================================================
500 // function : onTypeChanged()
501 // purpose : Group elements type radio button management
502 //=================================================================================
503 void SMESHGUI_GroupDlg::onTypeChanged (int id)
505 if (myTypeId != id) {
507 if (myCurrentLineEdit == 0)
508 setSelectionMode(id);
513 //=================================================================================
514 // function : onGrpTypeChanged()
515 // purpose : Group type radio button management
516 //=================================================================================
517 void SMESHGUI_GroupDlg::onGrpTypeChanged (int id)
519 if (myGrpTypeId != id) {
520 myWGStack->raiseWidget( id );
521 onSelectGeomGroup(id == 1);
526 //=================================================================================
527 // function : setSelectionMode()
528 // purpose : Radio button management
529 //=================================================================================
530 void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
533 if (myMesh->_is_nil())
536 if (mySelectionMode != theMode) {
537 mySelectionMgr->clearSelected();
538 mySelectionMgr->clearFilters();
539 SMESH::SetPointRepresentation(false);
544 myActor->SetPointRepresentation(true);
546 SMESH::SetPointRepresentation(true);
547 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
548 aViewWindow->SetSelectionMode(NodeSelection);
551 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
552 aViewWindow->SetSelectionMode(EdgeSelection);
555 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
556 aViewWindow->SetSelectionMode(FaceSelection);
559 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
560 aViewWindow->SetSelectionMode(VolumeSelection);
563 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
564 aViewWindow->SetSelectionMode(ActorSelection);
566 mySelectionMgr->installFilter(mySubMeshFilter);
567 else if (theMode == 5)
568 mySelectionMgr->installFilter(myGroupFilter);
569 else if (theMode == 6)
570 mySelectionMgr->installFilter(myMeshFilter);
572 mySelectionMode = theMode;
576 //=================================================================================
577 // function : onApply()
579 //=================================================================================
580 bool SMESHGUI_GroupDlg::onApply()
582 if (mySMESHGUI->isActiveStudyLocked())
585 if (myGrpTypeId == 0 &&
586 !myName->text().stripWhiteSpace().isEmpty() &&
587 myElements->count() > 0) {
588 mySelectionMgr->clearSelected();
589 if (myGroup->_is_nil()) {
590 SMESH::ElementType aType = SMESH::ALL;
592 case 0: aType = SMESH::NODE; break;
593 case 1: aType = SMESH::EDGE; break;
594 case 2: aType = SMESH::FACE; break;
595 case 3: aType = SMESH::VOLUME; break;
597 SMESH::long_array_var anIdList = new SMESH::long_array;
598 int i, k = myElements->count();
600 QListBoxItem* anItem;
601 for (i = 0, anItem = myElements->firstItem(); anItem != 0; i++, anItem = anItem->next()) {
602 anIdList[i] = anItem->text().toInt();
605 myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
606 myGroup->Add(anIdList.inout());
608 /* init for next operation */
611 myGroup = SMESH::SMESH_Group::_nil();
614 myGroup->SetName(myName->text());
616 QValueList<int> aAddList;
617 QValueList<int>::iterator anIt;
618 QListBoxItem* anItem;
620 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
621 int anId = anItem->text().toInt();
622 if ((anIt = myIdList.find(anId)) == myIdList.end())
623 aAddList.append(anId);
625 myIdList.remove(anIt);
627 if (!aAddList.empty()) {
628 SMESH::long_array_var anIdList = new SMESH::long_array;
629 anIdList->length(aAddList.count());
631 for (i = 0, anIt = aAddList.begin(); anIt != aAddList.end(); anIt++, i++)
633 myGroup->Add(anIdList.inout());
635 if (!myIdList.empty()) {
636 SMESH::long_array_var anIdList = new SMESH::long_array;
637 anIdList->length(myIdList.count());
639 for (i = 0, anIt = myIdList.begin(); anIt != myIdList.end(); anIt++, i++)
641 myGroup->Remove(anIdList.inout());
643 /* init for next operation */
645 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next())
646 myIdList.append(anItem->text().toInt());
649 mySMESHGUI->updateObjBrowser(true);
650 SMESH::UpdateView(); // asv: fix of BUG PAL5515
651 mySelectionMgr->clearSelected();
653 } else if (myGrpTypeId == 1 &&
654 !myName->text().stripWhiteSpace().isEmpty() &&
655 !CORBA::is_nil(myGeomGroup))
657 SMESH::ElementType aType = SMESH::ALL;
659 case 0: aType = SMESH::NODE; break;
660 case 1: aType = SMESH::EDGE; break;
661 case 2: aType = SMESH::FACE; break;
662 case 3: aType = SMESH::VOLUME; break;
665 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
666 GEOM::GEOM_IGroupOperations_var aGroupOp =
667 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
669 SMESH::SMESH_GroupOnGeom_var aGroupOnGeom =
670 myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomGroup);
672 mySMESHGUI->updateObjBrowser(true);
673 mySelectionMgr->clearSelected();
674 /* init for next operation */
682 //=================================================================================
685 //=================================================================================
686 void SMESHGUI_GroupDlg::onOK()
692 //=================================================================================
693 // function : onListSelectionChanged()
694 // purpose : Called when selection in element list is changed
695 //=================================================================================
696 void SMESHGUI_GroupDlg::onListSelectionChanged()
698 // MESSAGE("SMESHGUI_GroupDlg::onListSelectionChanged(); myActor = " << myActor);
699 if( myIsBusy || !myActor) return;
702 if (myCurrentLineEdit == 0) {
703 mySelectionMgr->clearSelected();
704 TColStd_MapOfInteger aIndexes;
705 QListBoxItem* anItem;
706 for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
707 if (anItem->isSelected()) {
708 int anId = anItem->text().toInt();
712 mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
714 aList.Append(myActor->getIO());
715 mySelectionMgr->setSelectedObjects(aList,false);
716 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
717 aViewWindow->highlight( myActor->getIO(), true, true );
722 //=================================================================================
723 // function : onObjectSelectionChanged()
724 // purpose : Called when selection in 3D view or ObjectBrowser is changed
725 //=================================================================================
726 void SMESHGUI_GroupDlg::onObjectSelectionChanged()
728 if ( myIsBusy || !isEnabled()) return;
732 mySelectionMgr->selectedObjects( aList );
734 int aNbSel = aList.Extent();
735 myElements->clearSelection();
737 if (myCurrentLineEdit) {
738 myCurrentLineEdit->setText("");
739 QString aString = "";
741 if (myCurrentLineEdit == myMeshGroupLine) {
742 mySelectSubMesh->setEnabled(false);
743 mySelectGroup->setEnabled(false);
744 myGroupLine->setText("");
745 mySubMeshLine->setText("");
747 myGeomGroupBtn->setEnabled(false);
748 myGeomGroupLine->setEnabled(false);
749 myGeomGroupLine->setText("");
756 myGroup = SMESH::SMESH_Group::_nil();
757 myMesh = SMESH::SMESH_Mesh::_nil();
761 Handle(SALOME_InteractiveObject) IO = aList.First();
764 myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
765 if (myMesh->_is_nil())
770 myGroup = SMESH::SMESH_Group::_nil();
772 myActor = SMESH::FindActorByObject(myMesh);
773 SMESH::SetPickable(myActor);
775 aString = aList.First()->getName();
776 myMeshGroupLine->setText(aString) ;
777 myMeshGroupLine->home( false );
779 mySelectSubMesh->setEnabled(true);
780 mySelectGroup->setEnabled(true);
781 myGeomGroupBtn->setEnabled(true);
782 myGeomGroupLine->setEnabled(true);
785 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(IO);
786 if (aGroup->_is_nil())
792 myCurrentLineEdit = 0;
795 mySelectSubMesh->setEnabled(true);
796 mySelectGroup->setEnabled(true);
797 myGeomGroupBtn->setEnabled(true);
798 myGeomGroupLine->setEnabled(true);
800 myCurrentLineEdit = 0;
809 setSelectionMode(myTypeId);
815 } else if (myCurrentLineEdit == myGeomGroupLine) {
817 myGeomGroup = GEOM::GEOM_Object::_nil();
822 Standard_Boolean testResult = Standard_False;
823 myGeomGroup = GEOMBase::ConvertIOinGEOMObject(aList.First(), testResult);
825 // Check if the object is a geometry group
826 if (!testResult || CORBA::is_nil(myGeomGroup)) {
827 myGeomGroup = GEOM::GEOM_Object::_nil();
831 // Check if group constructed on the same shape as a mesh or on its child
832 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
833 GEOM::GEOM_IGroupOperations_var anOp =
834 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
836 // The main shape of the group
837 GEOM::GEOM_Object_var aGroupMainShape;
838 if (myGeomGroup->GetType() == 37)
839 aGroupMainShape = anOp->GetMainShape(myGeomGroup);
841 aGroupMainShape = GEOM::GEOM_Object::_duplicate(myGeomGroup);
842 _PTR(SObject) aGroupMainShapeSO =
843 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
844 aStudy->FindObjectIOR(aGroupMainShape->GetStudyEntry());
847 _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
849 myGeomGroup = GEOM::GEOM_Object::_nil();
853 _PTR(SObject) anObj, aRef;
854 bool isRefOrSubShape = false;
855 if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) {
856 //if (strcmp(aRef->GetID(), aGroupMainShapeSO->GetID()) == 0) {
857 if (aRef->GetID() == aGroupMainShapeSO->GetID()) {
858 isRefOrSubShape = true;
860 _PTR(SObject) aFather = aGroupMainShapeSO->GetFather();
861 _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent();
862 //while (!isRefOrSubShape && strcmp(aFather->GetID(), aComponent->GetID()) != 0) {
863 while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) {
864 //if (strcmp(aRef->GetID(), aFather->GetID()) == 0)
865 if (aRef->GetID() == aFather->GetID())
866 isRefOrSubShape = true;
868 aFather = aFather->GetFather();
872 if (!isRefOrSubShape) {
873 myGeomGroup = GEOM::GEOM_Object::_nil();
881 if(myCurrentLineEdit == mySubMeshLine)
882 aString = tr("SMESH_SUBMESH_SELECTED").arg(aNbSel);
883 else if(myCurrentLineEdit == myGroupLine || myCurrentLineEdit == myGeomGroupLine)
884 aString = tr("SMESH_GROUP_SELECTED").arg(aNbSel);
886 aString = aList.First()->getName();
890 myCurrentLineEdit->setText(aString);
891 myCurrentLineEdit->home(false);
896 if (aNbSel == 1 && myActor ) {
897 QString aListStr = "";
900 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
902 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
905 QStringList anElements = QStringList::split(" ", aListStr);
906 QListBoxItem* anItem = 0;
907 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
908 anItem = myElements->findItem(*it, Qt::ExactMatch);
909 if (anItem) myElements->setSelected(anItem, true);
916 if (!myGroup->_is_nil())
917 myActor = SMESH::FindActorByObject(myGroup);
919 myActor = SMESH::FindActorByObject(myMesh);
925 //=================================================================================
926 // function : onSelectSubMesh()
927 // purpose : Called when selection in 3D view or ObjectBrowser is changed
928 //=================================================================================
929 void SMESHGUI_GroupDlg::onSelectSubMesh(bool on)
932 if (mySelectGroup->isChecked()) {
933 mySelectGroup->setChecked(false);
935 //VSR: else if (mySelectGeomGroup->isChecked()) {
936 //VSR: mySelectGeomGroup->setChecked(false);
938 myCurrentLineEdit = mySubMeshLine;
942 mySubMeshLine->setText("");
943 myCurrentLineEdit = 0;
945 setSelectionMode(myTypeId);
947 mySubMeshBtn->setEnabled(on);
948 mySubMeshLine->setEnabled(on);
952 //=================================================================================
953 // function : (onSelectGroup)
954 // purpose : Called when selection in 3D view or ObjectBrowser is changed
955 //=================================================================================
956 void SMESHGUI_GroupDlg::onSelectGroup(bool on)
959 if (mySelectSubMesh->isChecked()) {
960 mySelectSubMesh->setChecked(false);
962 myCurrentLineEdit = myGroupLine;
966 myGroupLine->setText("");
967 myCurrentLineEdit = 0;
969 setSelectionMode(myTypeId);
971 myGroupBtn->setEnabled(on);
972 myGroupLine->setEnabled(on);
976 //=================================================================================
977 // function : (onSelectGeomGroup)
978 // purpose : Called when selection in 3D view or ObjectBrowser is changed
979 //=================================================================================
980 void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
983 if (mySelectSubMesh->isChecked()) {
984 mySelectSubMesh->setChecked(false);
986 else if (mySelectGroup->isChecked()) {
987 mySelectGroup->setChecked(false);
989 myCurrentLineEdit = myGeomGroupLine;
993 myGeomGroupLine->setText("");
994 myCurrentLineEdit = 0;
996 setSelectionMode(myTypeId);
1001 //=================================================================================
1002 // function : setCurrentSelection()
1004 //=================================================================================
1005 void SMESHGUI_GroupDlg::setCurrentSelection()
1007 QPushButton* send = (QPushButton*)sender();
1008 myCurrentLineEdit = 0;
1009 if (send == myMeshGroupBtn) {
1010 myCurrentLineEdit = myMeshGroupLine;
1012 setSelectionMode(6);
1014 setSelectionMode(5);
1015 onObjectSelectionChanged();
1017 else if (send == mySubMeshBtn) {
1018 myCurrentLineEdit = mySubMeshLine;
1019 onObjectSelectionChanged();
1021 else if (send == myGroupBtn) {
1022 myCurrentLineEdit = myGroupLine;
1023 onObjectSelectionChanged();
1025 else if (send == myGeomGroupBtn) {
1026 myCurrentLineEdit = myGeomGroupLine;
1027 setSelectionMode(7);
1028 onObjectSelectionChanged();
1033 //=================================================================================
1034 // function : setFilters()
1035 // purpose : SLOT. Called when "Filter" button pressed.
1036 //=================================================================================
1037 void SMESHGUI_GroupDlg::setFilters()
1039 SMESH::ElementType aType = SMESH::ALL;
1042 case 0 : aType = SMESH::NODE; break;
1043 case 1 : aType = SMESH::EDGE; break;
1044 case 2 : aType = SMESH::FACE; break;
1045 case 3 : aType = SMESH::VOLUME; break;
1049 if ( myFilterDlg == 0 )
1051 myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, aType );
1052 connect( myFilterDlg, SIGNAL( Accepted() ), SLOT( onFilterAccepted() ) );
1055 myFilterDlg->Init( aType );
1057 myFilterDlg->SetSelection();
1058 myFilterDlg->SetMesh( myMesh );
1059 myFilterDlg->SetSourceWg( myElements );
1061 myFilterDlg->show();
1064 //=================================================================================
1065 // function : onFilterAccepted()
1066 // purpose : SLOT. Called when Filter dlg closed with OK button.
1067 // Uncheck "Select submesh" and "Select group" checkboxes
1068 //=================================================================================
1069 void SMESHGUI_GroupDlg::onFilterAccepted()
1071 if ( mySelectSubMesh->isChecked() || mySelectGroup->isChecked() )
1073 mySelectionMode = myTypeId;
1074 mySelectSubMesh->setChecked( false );
1075 mySelectGroup->setChecked( false );
1079 //=================================================================================
1080 // function : onAdd()
1082 //=================================================================================
1083 void SMESHGUI_GroupDlg::onAdd()
1085 SALOME_ListIO aList;
1086 mySelectionMgr->selectedObjects( aList );
1088 int aNbSel = aList.Extent();
1090 if (aNbSel == 0 || !myActor || myMesh->_is_nil()) return;
1094 SMESH::ElementType aType = SMESH::ALL;
1096 case 0: aType = SMESH::NODE; break;
1097 case 1: aType = SMESH::EDGE; break;
1098 case 2: aType = SMESH::FACE; break;
1099 case 3: aType = SMESH::VOLUME; break;
1102 if (myCurrentLineEdit == 0) {
1103 //if (aNbSel != 1) { myIsBusy = false; return; }
1104 QString aListStr = "";
1106 if (myTypeId == 0) {
1107 aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
1110 aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
1113 QStringList anElements = QStringList::split(" ", aListStr);
1114 QListBoxItem* anItem = 0;
1115 for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
1116 anItem = myElements->findItem(*it, Qt::ExactMatch);
1118 anItem = new QListBoxText(*it);
1119 myElements->insertItem(anItem);
1121 myElements->setSelected(anItem, true);
1124 } else if (myCurrentLineEdit == mySubMeshLine) {
1125 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1127 SALOME_ListIO aList;
1128 mySelectionMgr->selectedObjects( aList );
1130 SALOME_ListIteratorOfListIO anIt (aList);
1131 for (; anIt.More(); anIt.Next()) {
1132 SMESH::SMESH_subMesh_var aSubMesh =
1133 SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1134 if (!aSubMesh->_is_nil()) {
1135 // check if mesh is the same
1136 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1138 SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
1139 int k = anElements->length();
1140 QListBoxItem* anItem = 0;
1141 for (int i = 0; i < k; i++) {
1142 QString aText = QString::number(anElements[i]);
1143 anItem = myElements->findItem(aText, Qt::ExactMatch);
1145 anItem = new QListBoxText(aText);
1146 myElements->insertItem(anItem);
1148 myElements->setSelected(anItem, true);
1151 catch (const SALOME::SALOME_Exception& ex) {
1152 SalomeApp_Tools::QtCatchCorbaException(ex);
1157 mySelectSubMesh->setChecked(false);
1159 onListSelectionChanged();
1161 } else if (myCurrentLineEdit == myGroupLine) {
1162 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1163 SALOME_ListIO aList;
1164 mySelectionMgr->selectedObjects( aList );
1166 SALOME_ListIteratorOfListIO anIt (aList);
1167 for (; anIt.More(); anIt.Next()) {
1168 SMESH::SMESH_Group_var aGroup =
1169 SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1170 if (!aGroup->_is_nil()) {
1171 // check if mesh is the same
1172 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1173 SMESH::long_array_var anElements = aGroup->GetListOfID();
1174 int k = anElements->length();
1175 QListBoxItem* anItem = 0;
1176 for (int i = 0; i < k; i++) {
1177 QString aText = QString::number(anElements[i]);
1178 anItem = myElements->findItem(aText, Qt::ExactMatch);
1180 anItem = new QListBoxText(aText);
1181 myElements->insertItem(anItem);
1183 myElements->setSelected(anItem, true);
1188 mySelectGroup->setChecked(false);
1190 onListSelectionChanged();
1192 } else if (myCurrentLineEdit == myGeomGroupLine && !CORBA::is_nil(myGeomGroup)) {
1193 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
1194 GEOM::GEOM_IGroupOperations_var aGroupOp =
1195 SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
1197 SMESH::ElementType aGroupType = SMESH::ALL;
1198 switch(aGroupOp->GetType(myGeomGroup)) {
1199 case 7: aGroupType = SMESH::NODE; break;
1200 case 6: aGroupType = SMESH::EDGE; break;
1201 case 4: aGroupType = SMESH::FACE; break;
1202 case 2: aGroupType = SMESH::VOLUME; break;
1203 default: myIsBusy = false; return;
1206 if (aGroupType == aType) {
1207 _PTR(SObject) aGroupSO =
1208 //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
1209 aStudy->FindObjectIOR(myGeomGroup->GetStudyEntry());
1211 SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
1212 SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
1213 SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom();;
1214 aBelongToGeom->SetGeom(myGeomGroup);
1215 aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str());
1216 aBelongToGeom->SetElementType(aType);
1217 aFilter->SetPredicate(aBelongToGeom);
1219 SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh);
1221 int k = anElements->length();
1222 QListBoxItem* anItem = 0;
1223 for (int i = 0; i < k; i++) {
1224 QString aText = QString::number(anElements[i]);
1225 anItem = myElements->findItem(aText, Qt::ExactMatch);
1227 anItem = new QListBoxText(aText);
1228 myElements->insertItem(anItem);
1230 myElements->setSelected(anItem, true);
1234 //VSR: mySelectGeomGroup->setChecked(false);
1236 onListSelectionChanged();
1239 // mySelectionMgr->clearSelected();
1243 //=================================================================================
1244 // function : onRemove()
1246 //=================================================================================
1247 void SMESHGUI_GroupDlg::onRemove()
1250 if (myCurrentLineEdit == 0) {
1251 for (int i = myElements->count(); i > 0; i--) {
1252 if (myElements->isSelected(i-1)) {
1253 myElements->removeItem(i-1);
1257 SALOME_ListIO aList;
1258 mySelectionMgr->selectedObjects( aList );
1260 int aNbSel = aList.Extent();
1262 if (aNbSel == 0) { myIsBusy = false; return; }
1264 SMESH::ElementType aType = SMESH::ALL;
1266 case 0: aType = SMESH::NODE; break;
1267 case 1: aType = SMESH::EDGE; break;
1268 case 2: aType = SMESH::FACE; break;
1269 case 3: aType = SMESH::VOLUME; break;
1272 if (myCurrentLineEdit == mySubMeshLine) {
1273 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1274 SALOME_ListIO aList;
1275 mySelectionMgr->selectedObjects( aList );
1277 SALOME_ListIteratorOfListIO anIt (aList);
1278 for (; anIt.More(); anIt.Next()) {
1279 SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
1280 if (!aSubMesh->_is_nil()) {
1281 // check if mesh is the same
1282 if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
1283 if (aType == SMESH::NODE) {
1285 SMESH::long_array_var anElements = aSubMesh->GetNodesId();
1286 int k = anElements->length();
1287 QListBoxItem* anItem = 0;
1288 for (int i = 0; i < k; i++) {
1289 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1290 if (anItem) delete anItem;
1293 catch (const SALOME::SALOME_Exception& ex) {
1294 SalomeApp_Tools::QtCatchCorbaException(ex);
1299 SMESH::long_array_var anElements = aSubMesh->GetElementsId();
1300 int k = anElements->length();
1301 QListBoxItem* anItem = 0;
1302 for (int i = 0; i < k; i++) {
1303 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1304 if (anItem) delete anItem;
1307 catch (const SALOME::SALOME_Exception& ex) {
1308 SalomeApp_Tools::QtCatchCorbaException(ex);
1315 else if (myCurrentLineEdit == myGroupLine) {
1316 Standard_Boolean aRes;
1317 //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
1318 SALOME_ListIO aList;
1319 mySelectionMgr->selectedObjects( aList );
1321 SALOME_ListIteratorOfListIO anIt (aList);
1322 for (; anIt.More(); anIt.Next()) {
1323 SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
1324 if (aRes && !aGroup->_is_nil()) {
1325 // check if mesh is the same
1326 if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
1327 SMESH::long_array_var anElements = aGroup->GetListOfID();
1328 int k = anElements->length();
1329 QListBoxItem* anItem = 0;
1330 for (int i = 0; i < k; i++) {
1331 anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
1332 if (anItem) delete anItem;
1343 //=================================================================================
1344 // function : onSort()
1346 //=================================================================================
1347 void SMESHGUI_GroupDlg::onSort()
1349 // PAL5412: sorts items in ascending by "string" value
1350 // myElements->sort(true);
1351 // myElements->update();
1352 int i, k = myElements->count();
1355 QStringList aSelected;
1356 std::vector<int> anArray(k);
1357 // QMemArray<int> anArray(k);
1358 QListBoxItem* anItem;
1360 for (anItem = myElements->firstItem(), i = 0; anItem != 0; anItem = anItem->next(), i++) {
1361 anArray[i] = anItem->text().toInt();
1362 if (anItem->isSelected())
1363 aSelected.append(anItem->text());
1365 // sort & update list
1366 std::sort(anArray.begin(), anArray.end());
1368 myElements->clear();
1369 for (i = 0; i < k; i++) {
1370 myElements->insertItem(QString::number(anArray[i]));
1372 for (QStringList::iterator it = aSelected.begin(); it != aSelected.end(); ++it) {
1373 anItem = myElements->findItem(*it, Qt::ExactMatch);
1374 if (anItem) myElements->setSelected(anItem, true);
1380 //=================================================================================
1381 // function : closeEvent()
1383 //=================================================================================
1384 void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*)
1389 //=================================================================================
1390 // function : SMESHGUI_GroupDlg::onClose
1391 // purpose : SLOT called when "Close" button pressed. Close dialog
1392 //=================================================================================
1393 void SMESHGUI_GroupDlg::onClose()
1395 if (SMESH::GetCurrentVtkView()) {
1396 SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
1397 SMESH::SetPointRepresentation(false);
1398 SMESH::SetPickable();
1401 mySelectionMgr->clearSelected();
1402 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1403 aViewWindow->SetSelectionMode(ActorSelection);
1404 mySelectionMgr->clearFilters();
1405 mySMESHGUI->ResetState();
1410 //=================================================================================
1411 // function : SMESHGUI_GroupDlg::onDeactivate
1412 // purpose : SLOT called when dialog must be deativated
1413 //=================================================================================
1414 void SMESHGUI_GroupDlg::onDeactivate()
1416 mySMESHGUI->ResetState();
1420 //=================================================================================
1421 // function : SMESHGUI_GroupDlg::enterEvent
1422 // purpose : Event filter
1423 //=================================================================================
1424 void SMESHGUI_GroupDlg::enterEvent (QEvent*)
1427 mySMESHGUI->EmitSignalDeactivateDialog();
1429 mySelectionMode = -1;
1430 setSelectionMode(myTypeId);
1431 //mySMESHGUI->SetActiveDialogBox((QDialog*)this);
1432 mySMESHGUI->SetActiveDialogBox(this);
1433 mySMESHGUI->SetState(800);
1437 //=================================================================================
1438 // function : hideEvent
1439 // purpose : caused by ESC key
1440 //=================================================================================
1441 void SMESHGUI_GroupDlg::hideEvent (QHideEvent*)