1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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, or (at your option) any later version.
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.com
23 // SMESH SMESHGUI : GUI for SMESH component
24 // File : SMESHGUI_MergeDlg.cxx
25 // Author : Open CASCADE S.A.S.
28 #include "SMESHGUI_MergeDlg.h"
31 #include "SMESHGUI_Utils.h"
32 #include "SMESHGUI_VTKUtils.h"
33 #include "SMESHGUI_MeshUtils.h"
34 #include "SMESHGUI_SpinBox.h"
36 #include <SMESH_Actor.h>
37 #include <SMESH_TypeFilter.hxx>
38 #include <SMESH_LogicalFilter.hxx>
39 #include <SMDS_Mesh.hxx>
41 // SALOME GUI includes
42 #include <SUIT_Desktop.h>
43 #include <SUIT_ResourceMgr.h>
44 #include <SUIT_Session.h>
45 #include <SUIT_MessageBox.h>
46 #include <SUIT_OverrideCursor.h>
48 #include <LightApp_Application.h>
49 #include <LightApp_SelectionMgr.h>
51 #include <SVTK_ViewModel.h>
52 #include <SVTK_ViewWindow.h>
53 #include <SALOME_ListIO.hxx>
56 #include <TColStd_MapOfInteger.hxx>
57 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
60 #include <SALOMEconfig.h>
61 #include CORBA_SERVER_HEADER(SMESH_Group)
62 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
65 #include <vtkUnstructuredGrid.h>
66 #include <vtkRenderer.h>
67 #include <vtkActor2D.h>
68 #include <vtkPoints.h>
69 #include <vtkDataSetMapper.h>
70 #include <vtkMaskPoints.h>
71 #include <vtkSelectVisiblePoints.h>
72 #include <vtkLabeledDataMapper.h>
73 #include <vtkTextProperty.h>
74 #include <vtkIntArray.h>
75 #include <vtkProperty2D.h>
76 #include <vtkPointData.h>
79 #include <QApplication>
83 #include <QListWidget>
84 #include <QPushButton>
85 #include <QRadioButton>
87 #include <QHBoxLayout>
88 #include <QVBoxLayout>
89 #include <QGridLayout>
91 #include <QButtonGroup>
98 enum ActionType { MERGE_NODES, MERGE_ELEMENTS };
103 { // to display in the viewer IDs of the selected elements
104 SVTK_ViewWindow* myViewWindow;
106 vtkUnstructuredGrid* myIdGrid;
107 SALOME_Actor* myIdActor;
109 vtkUnstructuredGrid* myPointsNumDataSet;
110 vtkMaskPoints* myPtsMaskPoints;
111 vtkSelectVisiblePoints* myPtsSelectVisiblePoints;
112 vtkLabeledDataMapper* myPtsLabeledDataMapper;
113 vtkTextProperty* aPtsTextProp;
114 bool myIsPointsLabeled;
115 vtkActor2D* myPointLabels;
117 std::vector<int> myIDs;
120 TIdPreview(SVTK_ViewWindow* theViewWindow):
121 myViewWindow(theViewWindow)
123 myIdGrid = vtkUnstructuredGrid::New();
125 // Create and display actor
126 vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
127 aMapper->SetInputData( myIdGrid );
129 myIdActor = SALOME_Actor::New();
130 myIdActor->SetInfinitive(true);
131 myIdActor->VisibilityOff();
132 myIdActor->PickableOff();
134 myIdActor->SetMapper( aMapper );
137 myViewWindow->AddActor(myIdActor);
139 //Definition of points numbering pipeline
140 myPointsNumDataSet = vtkUnstructuredGrid::New();
142 myPtsMaskPoints = vtkMaskPoints::New();
143 myPtsMaskPoints->SetInputData(myPointsNumDataSet);
144 myPtsMaskPoints->SetOnRatio(1);
146 myPtsSelectVisiblePoints = vtkSelectVisiblePoints::New();
147 myPtsSelectVisiblePoints->SetInputConnection(myPtsMaskPoints->GetOutputPort());
148 myPtsSelectVisiblePoints->SelectInvisibleOff();
149 myPtsSelectVisiblePoints->SetTolerance(0.1);
151 myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
152 myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort());
153 myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
155 vtkTextProperty* aPtsTextProp = vtkTextProperty::New();
156 aPtsTextProp->SetFontFamilyToTimes();
157 static int aPointsFontSize = 12;
158 aPtsTextProp->SetFontSize(aPointsFontSize);
159 aPtsTextProp->SetBold(1);
160 aPtsTextProp->SetItalic(0);
161 aPtsTextProp->SetShadow(0);
162 myPtsLabeledDataMapper->SetLabelTextProperty(aPtsTextProp);
163 aPtsTextProp->Delete();
165 myIsPointsLabeled = false;
167 myPointLabels = vtkActor2D::New();
168 myPointLabels->SetMapper(myPtsLabeledDataMapper);
169 myPointLabels->GetProperty()->SetColor(1,1,1);
170 myPointLabels->SetVisibility(myIsPointsLabeled);
172 AddToRender(myViewWindow->getRenderer());
175 void SetPointsData ( SMDS_Mesh* theMesh,
176 TColStd_MapOfInteger & theNodesIdMap )
178 vtkPoints* aPoints = vtkPoints::New();
179 aPoints->SetNumberOfPoints(theNodesIdMap.Extent());
182 TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap );
183 for( int i = 0; idIter.More(); idIter.Next(), i++ ) {
184 const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
185 aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() );
186 myIDs.push_back(idIter.Key());
189 myIdGrid->SetPoints(aPoints);
193 myIdActor->GetMapper()->Update();
196 void SetElemsData( TColStd_MapOfInteger & theElemsIdMap,
197 std::list<gp_XYZ> & aGrCentersXYZ )
199 vtkPoints* aPoints = vtkPoints::New();
200 aPoints->SetNumberOfPoints(theElemsIdMap.Extent());
203 TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap );
204 for( ; idIter.More(); idIter.Next() ) {
205 myIDs.push_back(idIter.Key());
209 std::list<gp_XYZ>::iterator coordIt = aGrCentersXYZ.begin();
210 for( int i = 0; coordIt != aGrCentersXYZ.end(); coordIt++, i++ ) {
212 aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() );
214 myIdGrid->SetPoints(aPoints);
217 myIdActor->GetMapper()->Update();
220 void AddToRender(vtkRenderer* theRenderer)
222 myIdActor->AddToRender(theRenderer);
224 myPtsSelectVisiblePoints->SetRenderer(theRenderer);
225 theRenderer->AddActor2D(myPointLabels);
228 void RemoveFromRender(vtkRenderer* theRenderer)
230 myIdActor->RemoveFromRender(theRenderer);
232 myPtsSelectVisiblePoints->SetRenderer(theRenderer);
233 theRenderer->RemoveActor(myPointLabels);
236 void SetPointsLabeled( bool theIsPointsLabeled, bool theIsActorVisible = true )
238 myIsPointsLabeled = theIsPointsLabeled && myIdGrid->GetNumberOfPoints();
240 if ( myIsPointsLabeled ) {
241 myPointsNumDataSet->ShallowCopy(myIdGrid);
242 vtkDataSet *aDataSet = myPointsNumDataSet;
243 int aNbElem = myIDs.size();
244 vtkIntArray *anArray = vtkIntArray::New();
245 anArray->SetNumberOfValues( aNbElem );
246 for ( int i = 0; i < aNbElem; i++ )
247 anArray->SetValue( i, myIDs[i] );
248 aDataSet->GetPointData()->SetScalars( anArray );
250 myPtsMaskPoints->SetInputData( aDataSet );
251 myPointLabels->SetVisibility( theIsActorVisible );
254 myPointLabels->SetVisibility( false );
260 RemoveFromRender(myViewWindow->getRenderer());
264 myViewWindow->RemoveActor(myIdActor);
267 //Deleting of points numbering pipeline
268 //---------------------------------------
269 myPointsNumDataSet->Delete();
271 //myPtsLabeledDataMapper->RemoveAllInputs(); //vtk 5.0 porting
272 myPtsLabeledDataMapper->Delete();
274 //myPtsSelectVisiblePoints->UnRegisterAllOutputs(); //vtk 5.0 porting
275 myPtsSelectVisiblePoints->Delete();
277 //myPtsMaskPoints->UnRegisterAllOutputs(); //vtk 5.0 porting
278 myPtsMaskPoints->Delete();
280 myPointLabels->Delete();
282 // myTimeStamp->Delete();
287 static const char * IconFirst[] = {
302 //=================================================================================
303 // class : SMESHGUI_MergeDlg()
305 //=================================================================================
306 SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction)
307 : QDialog(SMESH::GetDesktop(theModule)),
308 mySMESHGUI(theModule),
309 mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
313 setAttribute(Qt::WA_DeleteOnClose, true);
314 setWindowTitle(myAction == MERGE_ELEMENTS ? tr("SMESH_MERGE_ELEMENTS") : tr("SMESH_MERGE_NODES"));
316 myIdPreview = new SMESH::TIdPreview(SMESH::GetViewWindow( mySMESHGUI ));
318 SUIT_ResourceMgr* aResMgr = SMESH::GetResourceMgr( mySMESHGUI );
319 QPixmap IconMergeNodes (aResMgr->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES")));
320 QPixmap IconMergeElems (aResMgr->loadPixmap("SMESH", tr("ICON_DLG_MERGE_ELEMENTS")));
321 QPixmap IconSelect (aResMgr->loadPixmap("SMESH", tr("ICON_SELECT")));
322 QPixmap IconAdd (aResMgr->loadPixmap("SMESH", tr("ICON_APPEND")));
323 QPixmap IconRemove (aResMgr->loadPixmap("SMESH", tr("ICON_REMOVE")));
325 setSizeGripEnabled(true);
327 QVBoxLayout* DlgLayout = new QVBoxLayout(this);
328 DlgLayout->setSpacing(SPACING);
329 DlgLayout->setMargin(MARGIN);
331 /***************************************************************/
332 GroupConstructors = new QGroupBox(myAction == MERGE_ELEMENTS ?
333 tr("SMESH_MERGE_ELEMENTS") :
334 tr("SMESH_MERGE_NODES"),
337 QButtonGroup* ButtonGroup = new QButtonGroup(this);
338 QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
339 GroupConstructorsLayout->setSpacing(SPACING);
340 GroupConstructorsLayout->setMargin(MARGIN);
342 RadioButton = new QRadioButton(GroupConstructors);
343 RadioButton->setIcon(myAction == MERGE_ELEMENTS ? IconMergeElems : IconMergeNodes);
344 RadioButton->setChecked(true);
345 GroupConstructorsLayout->addWidget(RadioButton);
346 ButtonGroup->addButton(RadioButton, 0);
348 /***************************************************************/
349 // Controls for mesh defining
350 GroupMesh = new QGroupBox(tr("SMESH_SELECT_WHOLE_MESH"), this);
351 QHBoxLayout* GroupMeshLayout = new QHBoxLayout(GroupMesh);
352 GroupMeshLayout->setSpacing(SPACING);
353 GroupMeshLayout->setMargin(MARGIN);
355 TextLabelName = new QLabel(tr("SMESH_NAME"), GroupMesh);
356 SelectMeshButton = new QPushButton(GroupMesh);
357 SelectMeshButton->setIcon(IconSelect);
358 LineEditMesh = new QLineEdit(GroupMesh);
359 LineEditMesh->setReadOnly(true);
361 GroupMeshLayout->addWidget(TextLabelName);
362 GroupMeshLayout->addWidget(SelectMeshButton);
363 GroupMeshLayout->addWidget(LineEditMesh);
365 /***************************************************************/
366 // Controls for switch dialog behaviour
368 TypeBox = new QGroupBox( tr( "SMESH_MODE" ), this );
369 GroupType = new QButtonGroup( this );
370 QHBoxLayout* aTypeBoxLayout = new QHBoxLayout( TypeBox );
371 aTypeBoxLayout->setMargin( MARGIN );
372 aTypeBoxLayout->setSpacing( SPACING );
374 QRadioButton* rb1 = new QRadioButton( tr( "SMESH_AUTOMATIC" ), TypeBox );
375 QRadioButton* rb2 = new QRadioButton( tr( "SMESH_MANUAL" ), TypeBox );
376 GroupType->addButton( rb1, 0 );
377 GroupType->addButton( rb2, 1 );
378 aTypeBoxLayout->addWidget( rb1 );
379 aTypeBoxLayout->addWidget( rb2 );
383 /***************************************************************/
384 // Controls for coincident elements detecting
385 GroupCoincident = new QGroupBox(myAction == MERGE_ELEMENTS ?
386 tr("COINCIDENT_ELEMENTS") :
387 tr("COINCIDENT_NODES"),
390 QVBoxLayout* aCoincidentLayout = new QVBoxLayout(GroupCoincident);
391 aCoincidentLayout->setSpacing(SPACING);
392 aCoincidentLayout->setMargin(MARGIN);
394 if (myAction == MERGE_NODES) // case merge nodes
396 QWidget* foo = new QWidget(GroupCoincident);
397 TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), foo);
398 SpinBoxTolerance = new SMESHGUI_SpinBox(foo);
399 SpinBoxTolerance->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
401 SeparateCornersAndMedium = new QCheckBox(tr("SEPARATE_CORNERS_AND_MEDIUM"), foo);
402 SeparateCornersAndMedium->setEnabled( false );
404 GroupExclude = new QGroupBox(tr("EXCLUDE_GROUPS"), foo);
405 GroupExclude->setCheckable( true );
406 GroupExclude->setChecked( false );
407 ListExclude = new QListWidget( GroupExclude );
408 QVBoxLayout* GroupExcludeLayout = new QVBoxLayout(GroupExclude);
409 GroupExcludeLayout->setSpacing(SPACING);
410 GroupExcludeLayout->setMargin(MARGIN);
411 GroupExcludeLayout->addWidget(ListExclude);
413 QGridLayout* fooLayout = new QGridLayout( foo );
414 fooLayout->setSpacing(SPACING);
415 fooLayout->setMargin(0);
416 fooLayout->addWidget(TextLabelTolerance, 0, 0 );
417 fooLayout->addWidget(SpinBoxTolerance, 0, 1 );
418 fooLayout->addWidget(SeparateCornersAndMedium, 1, 0 );
419 fooLayout->addWidget(GroupExclude, 2, 0, 1, 2 );
420 aCoincidentLayout->addWidget(foo);
423 TextLabelTolerance = 0;
424 SpinBoxTolerance = 0;
429 GroupCoincidentWidget = new QWidget(GroupCoincident);
430 QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincidentWidget);
431 GroupCoincidentLayout->setSpacing(SPACING);
432 GroupCoincidentLayout->setMargin(0);
434 ListCoincident = new QListWidget(GroupCoincidentWidget);
435 ListCoincident->setSelectionMode(QListWidget::ExtendedSelection);
437 DetectButton = new QPushButton(tr("DETECT"), GroupCoincidentWidget);
438 AddGroupButton = new QPushButton(tr("SMESH_BUT_ADD"), GroupCoincidentWidget);
439 RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincidentWidget);
441 SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincidentWidget);
442 ShowIDs = new QCheckBox(myAction == MERGE_ELEMENTS ? tr("SHOW_ELEMS_IDS") : tr("SHOW_NODES_IDS"), GroupCoincidentWidget);
444 GroupCoincidentLayout->addWidget(ListCoincident, 0, 0, 4, 2);
445 GroupCoincidentLayout->addWidget(DetectButton, 0, 2);
446 GroupCoincidentLayout->addWidget(AddGroupButton, 2, 2);
447 GroupCoincidentLayout->addWidget(RemoveGroupButton, 3, 2);
448 GroupCoincidentLayout->addWidget(SelectAllCB, 4, 0);
449 GroupCoincidentLayout->addWidget(ShowIDs, 4, 1);
450 GroupCoincidentLayout->setRowMinimumHeight(1, 10);
451 GroupCoincidentLayout->setRowStretch(1, 5);
453 aCoincidentLayout->addWidget(GroupCoincidentWidget);
455 /***************************************************************/
456 // Controls for editing the selected group
457 GroupEdit = new QGroupBox(tr("EDIT_SELECTED_GROUP"), this);
458 QGridLayout* GroupEditLayout = new QGridLayout(GroupEdit);
459 GroupEditLayout->setSpacing(SPACING);
460 GroupEditLayout->setMargin(MARGIN);
462 ListEdit = new QListWidget(GroupEdit);
463 //ListEdit->setRowMode(QListBox::FixedNumber);
464 //ListEdit->setHScrollBarMode(QScrollView::AlwaysOn);
465 //ListEdit->setVScrollBarMode(QScrollView::AlwaysOff);
466 ListEdit->setFlow( QListView::LeftToRight );
467 ListEdit->setSelectionMode(QListWidget::ExtendedSelection);
469 AddElemButton = new QPushButton(GroupEdit);
470 AddElemButton->setIcon(IconAdd);
471 RemoveElemButton = new QPushButton(GroupEdit);
472 RemoveElemButton->setIcon(IconRemove);
473 SetFirstButton = new QPushButton(GroupEdit);
474 SetFirstButton->setIcon(QPixmap(IconFirst));
476 GroupEditLayout->addWidget(ListEdit, 0, 0, 2, 1);
477 GroupEditLayout->addWidget(AddElemButton, 0, 1);
478 GroupEditLayout->addWidget(RemoveElemButton, 0, 2);
479 GroupEditLayout->addWidget(SetFirstButton, 1, 1, 1, 2);
481 /***************************************************************/
482 GroupButtons = new QGroupBox(this);
483 QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
484 GroupButtonsLayout->setSpacing(SPACING);
485 GroupButtonsLayout->setMargin(MARGIN);
487 buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
488 buttonOk->setAutoDefault(true);
489 buttonOk->setDefault(true);
490 buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
491 buttonApply->setAutoDefault(true);
492 buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
493 buttonCancel->setAutoDefault(true);
494 buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
495 buttonHelp->setAutoDefault(true);
497 GroupButtonsLayout->addWidget(buttonOk);
498 GroupButtonsLayout->addSpacing(10);
499 GroupButtonsLayout->addWidget(buttonApply);
500 GroupButtonsLayout->addSpacing(10);
501 GroupButtonsLayout->addStretch();
502 GroupButtonsLayout->addWidget(buttonCancel);
503 GroupButtonsLayout->addWidget(buttonHelp);
505 /***************************************************************/
506 DlgLayout->addWidget(GroupConstructors);
507 DlgLayout->addWidget(GroupMesh);
508 DlgLayout->addWidget(TypeBox);
509 DlgLayout->addWidget(GroupCoincident);
510 DlgLayout->addWidget(GroupEdit);
511 DlgLayout->addWidget(GroupButtons);
513 GroupCoincidentWidget->setVisible( myAction != MERGE_NODES );
514 GroupCoincident ->setVisible( myAction == MERGE_NODES );
515 //if GroupExclude->setVisible( myAction == MERGE_NODES );
520 ShowIDs->setChecked( true );
522 Init(); // Initialisations
525 //=================================================================================
526 // function : ~SMESHGUI_MergeDlg()
527 // purpose : Destroys the object and frees any allocated resources
528 //=================================================================================
529 SMESHGUI_MergeDlg::~SMESHGUI_MergeDlg()
534 //=================================================================================
537 //=================================================================================
538 void SMESHGUI_MergeDlg::Init()
540 if ( myAction == MERGE_NODES ) {
541 SpinBoxTolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision");
542 SpinBoxTolerance->SetValue(1e-05);
545 RadioButton->setChecked(true);
547 GroupType->button(0)->setChecked(true);
549 myEditCurrentArgument = (QWidget*)LineEditMesh;
552 mySubMeshOrGroup = SMESH::SMESH_subMesh::_nil();
554 mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
556 mySMESHGUI->SetActiveDialogBox((QDialog*)this);
559 /* signals and slots connections */
560 connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
561 connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
562 connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
563 connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
565 connect(SelectMeshButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
566 connect(DetectButton, SIGNAL (clicked()), this, SLOT(onDetect()));
567 connect(ListCoincident, SIGNAL (itemSelectionChanged()), this, SLOT(onSelectGroup()));
568 connect(AddGroupButton, SIGNAL (clicked()), this, SLOT(onAddGroup()));
569 connect(RemoveGroupButton, SIGNAL (clicked()), this, SLOT(onRemoveGroup()));
570 connect(SelectAllCB, SIGNAL(toggled(bool)), this, SLOT(onSelectAll(bool)));
571 connect(ShowIDs, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup()));
572 connect(ListEdit, SIGNAL (itemSelectionChanged()), this, SLOT(onSelectElementFromGroup()));
573 connect(AddElemButton, SIGNAL (clicked()), this, SLOT(onAddElement()));
574 connect(RemoveElemButton, SIGNAL (clicked()), this, SLOT(onRemoveElement()));
575 connect(SetFirstButton, SIGNAL( clicked() ), this, SLOT( onSetFirst() ) );
576 connect(GroupType, SIGNAL(buttonClicked(int)), this, SLOT(onTypeChanged(int)));
578 connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
579 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
580 /* to close dialog if study change */
581 connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
582 connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
583 connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
584 // Init Mesh field from selection
585 SelectionIntoArgument();
590 if ( myAction == MERGE_NODES )
591 myHelpFileName = "merging_nodes_page.html";
593 myHelpFileName = "merging_elements_page.html";
596 //=================================================================================
597 // function : FindGravityCenter()
599 //=================================================================================
600 void SMESHGUI_MergeDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap,
601 std::list< gp_XYZ > & theGrCentersXYZ)
606 SMDS_Mesh* aMesh = 0;
607 aMesh = myActor->GetObject()->GetMesh();
613 TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap );
614 for( ; idIter.More(); idIter.Next() ) {
615 const SMDS_MeshElement* anElem = aMesh->FindElement(idIter.Key());
619 gp_XYZ anXYZ(0., 0., 0.);
620 SMDS_ElemIteratorPtr nodeIt = anElem->nodesIterator();
621 for ( nbNodes = 0; nodeIt->more(); nbNodes++ ) {
622 const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
623 anXYZ.Add( gp_XYZ( node->X(), node->Y(), node->Z() ) );
625 anXYZ.Divide( nbNodes );
627 theGrCentersXYZ.push_back( anXYZ );
631 //=================================================================================
632 // function : ClickOnApply()
634 //=================================================================================
635 bool SMESHGUI_MergeDlg::ClickOnApply()
637 if (mySMESHGUI->isActiveStudyLocked() || myMesh->_is_nil())
644 SUIT_OverrideCursor aWaitCursor;
645 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
647 SMESH::long_array_var anIds = new SMESH::long_array;
648 SMESH::array_of_long_array_var aGroupsOfElements = new SMESH::array_of_long_array;
650 if ( ListCoincident->count() == 0) {
651 if ( myAction == MERGE_NODES )
652 SUIT_MessageBox::warning(this,
654 tr("SMESH_NO_NODES_DETECTED"));
656 SUIT_MessageBox::warning(this,
658 tr("SMESH_NO_ELEMENTS_DETECTED"));
662 aGroupsOfElements->length(ListCoincident->count());
665 for (int i = 0; i < ListCoincident->count(); i++) {
666 QStringList aListIds = ListCoincident->item(i)->text().split(" ", QString::SkipEmptyParts);
668 anIds->length(aListIds.count());
669 for (int i = 0; i < aListIds.count(); i++)
670 anIds[i] = aListIds[i].toInt();
672 aGroupsOfElements[anArrayNum++] = anIds.inout();
675 if( myAction == MERGE_NODES )
676 aMeshEditor->MergeNodes (aGroupsOfElements.inout());
678 aMeshEditor->MergeElements (aGroupsOfElements.inout());
680 if ( myTypeId == 0 ) {
681 if (myAction == MERGE_NODES )
682 SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INFORMATION"),
683 tr("SMESH_MERGED_NODES").arg(QString::number(ListCoincident->count()).toLatin1().data()));
685 SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INFORMATION"),
686 tr("SMESH_MERGED_ELEMENTS").arg(QString::number(ListCoincident->count()).toLatin1().data()));
693 ListCoincident->clear();
695 myEditCurrentArgument = (QWidget*)LineEditMesh;
698 SMESHGUI::Modified();
703 //=================================================================================
704 // function : ClickOnOk()
706 //=================================================================================
707 void SMESHGUI_MergeDlg::ClickOnOk()
713 //=================================================================================
714 // function : reject()
716 //=================================================================================
717 void SMESHGUI_MergeDlg::reject()
719 myIdPreview->SetPointsLabeled(false);
720 SMESH::SetPointRepresentation(false);
721 disconnect(mySelectionMgr, 0, this, 0);
722 disconnect(mySMESHGUI, 0, this, 0);
723 mySMESHGUI->ResetState();
725 mySelectionMgr->clearFilters();
726 //mySelectionMgr->clearSelected();
728 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
729 aViewWindow->SetSelectionMode(ActorSelection);
734 //=================================================================================
735 // function : onOpenView()
737 //=================================================================================
738 void SMESHGUI_MergeDlg::onOpenView()
741 SMESH::SetPointRepresentation(false);
744 mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
745 ActivateThisDialog();
749 //=================================================================================
750 // function : onCloseView()
752 //=================================================================================
753 void SMESHGUI_MergeDlg::onCloseView()
755 DeactivateActiveDialog();
759 //=================================================================================
760 // function : ClickOnHelp()
762 //=================================================================================
763 void SMESHGUI_MergeDlg::ClickOnHelp()
765 LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
767 app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
771 platform = "winapplication";
773 platform = "application";
775 SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
776 tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
777 arg(app->resourceMgr()->stringValue("ExternalBrowser",
779 arg(myHelpFileName));
783 //=================================================================================
784 // function : onEditGroup()
786 //=================================================================================
787 void SMESHGUI_MergeDlg::onEditGroup()
789 QList<QListWidgetItem*> selItems = ListCoincident->selectedItems();
790 if ( selItems.count() != 1 ) {
797 for (int i = 0; i < ListEdit->count(); i++ )
798 aNewIds.append(ListEdit->item(i)->text());
800 ListCoincident->clearSelection();
801 selItems.first()->setText(aNewIds.join(" "));
802 selItems.first()->setSelected(true);
805 //=================================================================================
806 // function : updateControls()
808 //=================================================================================
809 void SMESHGUI_MergeDlg::updateControls()
811 if (ListEdit->count() == 0)
812 SetFirstButton->setEnabled(false);
813 bool enable = !(myMesh->_is_nil()) && (ListCoincident->count() || (myTypeId == 0));
814 buttonOk->setEnabled(enable);
815 buttonApply->setEnabled(enable);
816 DetectButton->setEnabled( !myMesh->_is_nil() );
818 if ( myAction == MERGE_NODES )
820 bool has2ndOrder = (( !myMesh->_is_nil() ) &&
821 ( myMesh->NbEdgesOfOrder( SMESH::ORDER_QUADRATIC ) > 0 ||
822 myMesh->NbFacesOfOrder( SMESH::ORDER_QUADRATIC ) > 0 ||
823 myMesh->NbVolumesOfOrder( SMESH::ORDER_QUADRATIC ) > 0 ));
825 SeparateCornersAndMedium->setEnabled( has2ndOrder );
829 //=================================================================================
830 // function : onDetect()
832 //=================================================================================
833 void SMESHGUI_MergeDlg::onDetect()
835 if ( myMesh->_is_nil() || LineEditMesh->text().isEmpty() )
839 SUIT_OverrideCursor aWaitCursor;
840 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
842 ListCoincident->clear();
845 SMESH::array_of_long_array_var aGroupsArray;
846 SMESH::ListOfIDSources_var aExcludeGroups = new SMESH::ListOfIDSources;
848 SMESH::SMESH_IDSource_var src;
849 if ( mySubMeshOrGroup->_is_nil() ) src = SMESH::SMESH_IDSource::_duplicate( myMesh );
850 else src = SMESH::SMESH_IDSource::_duplicate( mySubMeshOrGroup );
854 for ( int i = 0; GroupExclude->isChecked() && i < ListExclude->count(); i++ ) {
855 if ( ListExclude->item( i )->checkState() == Qt::Checked ) {
856 aExcludeGroups->length( aExcludeGroups->length()+1 );
857 aExcludeGroups[ aExcludeGroups->length()-1 ] = SMESH::SMESH_IDSource::_duplicate( myGroups[i] );
860 aMeshEditor->FindCoincidentNodesOnPartBut(src.in(),
861 SpinBoxTolerance->GetValue(),
864 SeparateCornersAndMedium->isEnabled() &&
865 SeparateCornersAndMedium->isChecked());
867 case MERGE_ELEMENTS :
868 aMeshEditor->FindEqualElements(src.in(), aGroupsArray.out());
872 for (int i = 0; i < aGroupsArray->length(); i++) {
873 SMESH::long_array& aGroup = aGroupsArray[i];
876 for (int j = 0; j < aGroup.length(); j++)
877 anIDs.append(QString::number(aGroup[j]));
879 ListCoincident->addItem(anIDs.join(" "));
884 ListCoincident->selectAll();
889 //=================================================================================
890 // function : onSelectGroup()
892 //=================================================================================
893 void SMESHGUI_MergeDlg::onSelectGroup()
895 if (myIsBusy || !myActor)
898 if( ListCoincident->count() != ListCoincident->selectedItems().count() )
899 SelectAllCB->setChecked( false );
901 myEditCurrentArgument = (QWidget*)ListCoincident;
906 TColStd_MapOfInteger anIndices;
907 QList<QListWidgetItem*> selItems = ListCoincident->selectedItems();
908 QListWidgetItem* anItem;
909 QStringList aListIds;
913 foreach(anItem, selItems) {
914 aListIds = anItem->text().split(" ", QString::SkipEmptyParts);
915 for (int i = 0; i < aListIds.count(); i++)
916 anIndices.Add(aListIds[i].toInt());
919 if (selItems.count() == 1) {
920 ListEdit->addItems(aListIds);
921 ListEdit->selectAll();
924 mySelector->AddOrRemoveIndex(myActor->getIO(), anIndices, false);
926 aList.Append(myActor->getIO());
927 mySelectionMgr->setSelectedObjects(aList,false);
929 if (ShowIDs->isChecked())
930 if ( myAction == MERGE_NODES ) {
931 myIdPreview->SetPointsData(myActor->GetObject()->GetMesh(), anIndices);
932 myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility());
935 std::list< gp_XYZ > aGrCentersXYZ;
936 FindGravityCenter(anIndices, aGrCentersXYZ);
937 myIdPreview->SetElemsData( anIndices, aGrCentersXYZ);
938 myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility());
941 myIdPreview->SetPointsLabeled(false);
947 //=================================================================================
948 // function : onSelectAll()
950 //=================================================================================
951 void SMESHGUI_MergeDlg::onSelectAll (bool isToggled)
954 ListCoincident->selectAll();
956 ListCoincident->clearSelection();
959 //=================================================================================
960 // function : onSelectElementFromGroup()
962 //=================================================================================
963 void SMESHGUI_MergeDlg::onSelectElementFromGroup()
965 if (myIsBusy || !myActor)
968 TColStd_MapOfInteger anIndices;
969 QList<QListWidgetItem*> selItems = ListEdit->selectedItems();
970 QListWidgetItem* anItem;
972 foreach(anItem, selItems)
973 anIndices.Add(anItem->text().toInt());
975 SetFirstButton->setEnabled(selItems.count() == 1);
977 mySelector->AddOrRemoveIndex(myActor->getIO(), anIndices, false);
979 aList.Append(myActor->getIO());
980 mySelectionMgr->setSelectedObjects(aList);
982 if (ShowIDs->isChecked())
983 if (myAction == MERGE_NODES) {
984 myIdPreview->SetPointsData(myActor->GetObject()->GetMesh(), anIndices);
985 myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility());
988 std::list< gp_XYZ > aGrCentersXYZ;
989 FindGravityCenter(anIndices, aGrCentersXYZ);
990 myIdPreview->SetElemsData(anIndices, aGrCentersXYZ);
991 myIdPreview->SetPointsLabeled(!anIndices.IsEmpty(), myActor->GetVisibility());
994 myIdPreview->SetPointsLabeled(false);
997 //=================================================================================
998 // function : onAddGroup()
1000 //=================================================================================
1001 void SMESHGUI_MergeDlg::onAddGroup()
1003 if ( myMesh->_is_nil() || LineEditMesh->text().isEmpty() )
1007 int aNbElements = 0;
1008 aNbElements = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), anIDs);
1010 if (aNbElements < 1)
1013 ListCoincident->clearSelection();
1014 ListCoincident->addItem(anIDs);
1015 int nbGroups = ListCoincident->count();
1017 ListCoincident->setCurrentRow(nbGroups-1);
1018 ListCoincident->item(nbGroups-1)->setSelected(true);
1021 // VSR ? this code seems to be never executed!!!
1022 ListCoincident->setCurrentRow(0);
1023 //ListCoincident->setSelected(0, true); // VSR: no items - no selection
1029 //=================================================================================
1030 // function : onRemoveGroup()
1032 //=================================================================================
1033 void SMESHGUI_MergeDlg::onRemoveGroup()
1035 if (myEditCurrentArgument != (QWidget*)ListCoincident)
1039 QList<QListWidgetItem*> selItems = ListCoincident->selectedItems();
1040 QListWidgetItem* anItem;
1042 foreach(anItem, selItems)
1046 myIdPreview->SetPointsLabeled(false);
1048 SMESH::UpdateView();
1051 if( ListCoincident->count() == 0 ) {
1052 myEditCurrentArgument = (QWidget*)LineEditMesh;
1053 SelectAllCB->setChecked( false );
1057 //=================================================================================
1058 // function : onAddElement()
1060 //=================================================================================
1061 void SMESHGUI_MergeDlg::onAddElement()
1067 QString aListStr = "";
1070 aNbNnodes = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
1074 QStringList aNodes = aListStr.split(" ", QString::SkipEmptyParts);
1076 for (QStringList::iterator it = aNodes.begin(); it != aNodes.end(); ++it) {
1077 QList<QListWidgetItem*> found = ListEdit->findItems(*it, Qt::MatchExactly);
1078 if ( found.count() == 0 ) {
1079 QListWidgetItem* anItem = new QListWidgetItem(*it);
1080 ListEdit->addItem(anItem);
1081 anItem->setSelected(true);
1084 QListWidgetItem* anItem;
1085 foreach(anItem, found) anItem->setSelected(true);
1093 //=================================================================================
1094 // function : onRemoveElement()
1096 //=================================================================================
1097 void SMESHGUI_MergeDlg::onRemoveElement()
1099 if (myEditCurrentArgument != (QWidget*)ListCoincident)
1103 QList<QListWidgetItem*> selItems = ListEdit->selectedItems();
1104 QListWidgetItem* anItem;
1106 foreach(anItem, selItems)
1112 if( ListCoincident->count() == 0 ) {
1113 myEditCurrentArgument = (QWidget*)LineEditMesh;
1114 SelectAllCB->setChecked( false );
1118 //=================================================================================
1119 // function : onSetFirst()
1121 //=================================================================================
1122 void SMESHGUI_MergeDlg::onSetFirst()
1124 if (myEditCurrentArgument != (QWidget*)ListCoincident)
1128 QList<QListWidgetItem*> selItems = ListEdit->selectedItems();
1129 QListWidgetItem* anItem;
1131 foreach(anItem, selItems) {
1132 ListEdit->takeItem(ListEdit->row(anItem));
1133 ListEdit->insertItem(0, anItem);
1140 //=================================================================================
1141 // function : SetEditCurrentArgument()
1143 //=================================================================================
1144 void SMESHGUI_MergeDlg::SetEditCurrentArgument()
1146 QPushButton* send = (QPushButton*)sender();
1148 disconnect(mySelectionMgr, 0, this, 0);
1149 mySelectionMgr->clearSelected();
1150 mySelectionMgr->clearFilters();
1152 if (send == SelectMeshButton) {
1153 myEditCurrentArgument = (QWidget*)LineEditMesh;
1154 SMESH::SetPointRepresentation(false);
1155 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1156 aViewWindow->SetSelectionMode(ActorSelection);
1158 mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
1161 myEditCurrentArgument->setFocus();
1162 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
1163 SelectionIntoArgument();
1166 //=================================================================================
1167 // function : SelectionIntoArgument()
1168 // purpose : Called when selection as changed or other case
1169 //=================================================================================
1170 void SMESHGUI_MergeDlg::SelectionIntoArgument()
1172 if (myEditCurrentArgument == (QWidget*)LineEditMesh) {
1173 QString aString = "";
1174 LineEditMesh->setText(aString);
1176 ListCoincident->clear();
1179 myMesh = SMESH::SMESH_Mesh::_nil();
1180 QString aCurrentEntry = myEntry;
1182 int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
1184 myIdPreview->SetPointsLabeled(false);
1185 SMESH::SetPointRepresentation(false);
1186 mySelectionMgr->clearFilters();
1187 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1188 aViewWindow->SetSelectionMode(ActorSelection);
1192 SALOME_ListIO aList;
1193 mySelectionMgr->selectedObjects(aList);
1195 Handle(SALOME_InteractiveObject) IO = aList.First();
1196 myEntry = IO->getEntry();
1197 myMesh = SMESH::GetMeshByIO(IO);
1199 if (myMesh->_is_nil())
1202 LineEditMesh->setText(aString);
1204 myActor = SMESH::FindActorByEntry(IO->getEntry());
1206 myActor = SMESH::FindActorByObject(myMesh);
1208 if ( myActor && myTypeId == 1 && mySelector->IsSelectionEnabled() ) {
1209 mySubMeshOrGroup = SMESH::SMESH_IDSource::_nil();
1210 mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
1212 if ((!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil() || //SUBMESH OR GROUP
1213 !SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO)->_is_nil()) &&
1214 !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
1215 mySubMeshOrGroup = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
1217 if (myAction == MERGE_NODES) {
1218 SMESH::SetPointRepresentation(true);
1219 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1220 aViewWindow->SetSelectionMode(NodeSelection);
1223 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1224 aViewWindow->SetSelectionMode(CellSelection);
1228 if ( myAction == MERGE_NODES && !myMesh->_is_nil() && myEntry != aCurrentEntry ) {
1230 ListExclude->clear();
1231 SMESH::ListOfGroups_var aListOfGroups = myMesh->GetGroups();
1232 for( int i = 0, n = aListOfGroups->length(); i < n; i++ ) {
1233 SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i];
1234 if ( !aGroup->_is_nil() ) { // && aGroup->GetType() == SMESH::NODE
1235 QString aGroupName( aGroup->GetName() );
1236 if ( !aGroupName.isEmpty() ) {
1237 myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup));
1238 QListWidgetItem* item = new QListWidgetItem( aGroupName );
1239 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable );
1240 item->setCheckState( Qt::Unchecked );
1241 ListExclude->addItem( item );
1251 //=================================================================================
1252 // function : DeactivateActiveDialog()
1254 //=================================================================================
1255 void SMESHGUI_MergeDlg::DeactivateActiveDialog()
1257 if (GroupConstructors->isEnabled()) {
1258 GroupConstructors->setEnabled(false);
1259 TypeBox->setEnabled(false);
1260 GroupMesh->setEnabled(false);
1261 GroupCoincident->setEnabled(false);
1262 GroupEdit->setEnabled(false);
1263 GroupButtons->setEnabled(false);
1264 mySMESHGUI->ResetState();
1265 mySMESHGUI->SetActiveDialogBox(0);
1268 mySelectionMgr->clearSelected();
1269 disconnect(mySelectionMgr, 0, this, 0);
1272 //=================================================================================
1273 // function : ActivateThisDialog()
1275 //=================================================================================
1276 void SMESHGUI_MergeDlg::ActivateThisDialog()
1278 /* Emit a signal to deactivate the active dialog */
1279 mySMESHGUI->EmitSignalDeactivateDialog();
1280 GroupConstructors->setEnabled(true);
1281 TypeBox->setEnabled(true);
1282 GroupMesh->setEnabled(true);
1283 GroupCoincident->setEnabled(true);
1284 GroupEdit->setEnabled(true);
1285 GroupButtons->setEnabled(true);
1287 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
1288 mySMESHGUI->SetActiveDialogBox((QDialog*)this);
1289 SelectionIntoArgument();
1292 //=================================================================================
1293 // function : enterEvent()
1295 //=================================================================================
1296 void SMESHGUI_MergeDlg::enterEvent (QEvent*)
1298 if ( !GroupConstructors->isEnabled() ) {
1299 SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
1300 if ( aViewWindow && !mySelector) {
1301 mySelector = aViewWindow->GetSelector();
1303 ActivateThisDialog();
1307 //=================================================================================
1308 // function : keyPressEvent()
1310 //=================================================================================
1311 void SMESHGUI_MergeDlg::keyPressEvent( QKeyEvent* e)
1313 QDialog::keyPressEvent( e );
1314 if ( e->isAccepted() )
1317 if ( e->key() == Qt::Key_F1 ) {
1323 //=================================================================================
1324 // function : onTypeChanged()
1325 // purpose : the type radio button management
1326 //=================================================================================
1327 void SMESHGUI_MergeDlg::onTypeChanged (int id)
1335 case 0: // automatic
1336 myIdPreview->SetPointsLabeled(false);
1337 SMESH::SetPointRepresentation(false);
1338 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1339 aViewWindow->SetSelectionMode(ActorSelection);
1340 mySelectionMgr->clearFilters();
1341 if (myAction == MERGE_NODES)
1342 GroupCoincidentWidget->hide();
1344 GroupCoincident->hide();
1349 SMESH::UpdateView();
1351 // Costruction of the logical filter
1352 SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (SMESH::MESHorSUBMESH);
1353 SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (SMESH::GROUP);
1355 QList<SUIT_SelectionFilter*> aListOfFilters;
1356 if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
1357 if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
1359 myMeshOrSubMeshOrGroupFilter =
1360 new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
1362 if (myAction == MERGE_NODES) {
1363 GroupCoincidentWidget->show();
1364 SMESH::SetPointRepresentation(true);
1365 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1366 if( mySelector->IsSelectionEnabled() )
1367 aViewWindow->SetSelectionMode(NodeSelection);
1370 GroupCoincident->show();
1371 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1372 if( mySelector->IsSelectionEnabled() )
1373 aViewWindow->SetSelectionMode(CellSelection);
1380 qApp->processEvents();
1384 SelectionIntoArgument();