X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_MergeDlg.cxx;h=10933a60c96484e20c4af50c18cb96595a0aef14;hp=ec442214e9bf56d0dfade8f515c324e0b5a6f413;hb=a274ade365bd0f0e19d56c577acc4a13aa1972a7;hpb=02ac54c6f33c5437c1d2204d704cf3da6fd31a8e diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx index ec442214e..10933a60c 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -54,7 +54,6 @@ #include // OCCT includes -#include #include // IDL includes @@ -102,7 +101,7 @@ QPixmap SMESHGUI_MergeDlg::IconFirst() " .. ... ... ", " .. .. .. ", " . . "}; - return iconFirst; + return QPixmap( iconFirst ); } //================================================================================= @@ -115,50 +114,49 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction) mySelectionMgr(SMESH::GetSelectionMgr(theModule)), myAction(theAction) { + const bool isElems = ( myAction == MERGE_ELEMENTS ); setModal(false); setAttribute(Qt::WA_DeleteOnClose, true); - setWindowTitle(myAction == MERGE_ELEMENTS ? tr("SMESH_MERGE_ELEMENTS") : tr("SMESH_MERGE_NODES")); + setWindowTitle( isElems ? tr("SMESH_MERGE_ELEMENTS") : tr("SMESH_MERGE_NODES")); myIdPreview = new SMESHGUI_IdPreview(SMESH::GetViewWindow( mySMESHGUI )); SUIT_ResourceMgr* aResMgr = SMESH::GetResourceMgr( mySMESHGUI ); - QPixmap IconMergeNodes (aResMgr->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES"))); - QPixmap IconMergeElems (aResMgr->loadPixmap("SMESH", tr("ICON_DLG_MERGE_ELEMENTS"))); + // QPixmap IconMergeNodes (aResMgr->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES"))); + // QPixmap IconMergeElems (aResMgr->loadPixmap("SMESH", tr("ICON_DLG_MERGE_ELEMENTS"))); QPixmap IconSelect (aResMgr->loadPixmap("SMESH", tr("ICON_SELECT"))); QPixmap IconAdd (aResMgr->loadPixmap("SMESH", tr("ICON_APPEND"))); QPixmap IconRemove (aResMgr->loadPixmap("SMESH", tr("ICON_REMOVE"))); setSizeGripEnabled(true); - QVBoxLayout* DlgLayout = new QVBoxLayout(this); - DlgLayout->setSpacing(SPACING); - DlgLayout->setMargin(MARGIN); - /***************************************************************/ - GroupConstructors = new QGroupBox(myAction == MERGE_ELEMENTS ? - tr("SMESH_MERGE_ELEMENTS") : - tr("SMESH_MERGE_NODES"), - this); - - QButtonGroup* ButtonGroup = new QButtonGroup(this); - QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors); - GroupConstructorsLayout->setSpacing(SPACING); - GroupConstructorsLayout->setMargin(MARGIN); - - RadioButton = new QRadioButton(GroupConstructors); - RadioButton->setIcon(myAction == MERGE_ELEMENTS ? IconMergeElems : IconMergeNodes); - RadioButton->setChecked(true); - GroupConstructorsLayout->addWidget(RadioButton); - ButtonGroup->addButton(RadioButton, 0); + // Controls to switch dialog behaviour (myTypeId) + + TypeBox = new QGroupBox( tr("SMESH_MODE"), this ); + GroupType = new QButtonGroup( this ); + QHBoxLayout* aTypeBoxLayout = new QHBoxLayout( TypeBox ); + aTypeBoxLayout->setMargin( MARGIN ); + aTypeBoxLayout->setSpacing( SPACING ); + + QRadioButton* rb1 = new QRadioButton( tr( "SMESH_AUTOMATIC" ), TypeBox ); + QRadioButton* rb2 = new QRadioButton( tr( "SMESH_MANUAL" ), TypeBox ); + GroupType->addButton( rb1, 0 ); + GroupType->addButton( rb2, 1 ); + aTypeBoxLayout->addWidget( rb1 ); + aTypeBoxLayout->addWidget( rb2 ); + + myTypeId = TYPE_AUTO; /***************************************************************/ // Controls for mesh defining + GroupMesh = new QGroupBox(tr("SMESH_SELECT_WHOLE_MESH"), this); QHBoxLayout* GroupMeshLayout = new QHBoxLayout(GroupMesh); GroupMeshLayout->setSpacing(SPACING); GroupMeshLayout->setMargin(MARGIN); - TextLabelName = new QLabel(tr("SMESH_NAME"), GroupMesh); + TextLabelName = new QLabel(tr("SMESH_NAMES"), GroupMesh); SelectMeshButton = new QPushButton(GroupMesh); SelectMeshButton->setIcon(IconSelect); LineEditMesh = new QLineEdit(GroupMesh); @@ -168,139 +166,127 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction) GroupMeshLayout->addWidget(SelectMeshButton); GroupMeshLayout->addWidget(LineEditMesh); - /***************************************************************/ - // Controls for switch dialog behaviour (myTypeId) - - TypeBox = new QGroupBox( tr( "SMESH_MODE" ), this ); - GroupType = new QButtonGroup( this ); - QHBoxLayout* aTypeBoxLayout = new QHBoxLayout( TypeBox ); - aTypeBoxLayout->setMargin( MARGIN ); - aTypeBoxLayout->setSpacing( SPACING ); - - QRadioButton* rb1 = new QRadioButton( tr( "SMESH_AUTOMATIC" ), TypeBox ); - QRadioButton* rb2 = new QRadioButton( tr( "SMESH_MANUAL" ), TypeBox ); - GroupType->addButton( rb1, 0 ); - GroupType->addButton( rb2, 1 ); - aTypeBoxLayout->addWidget( rb1 ); - aTypeBoxLayout->addWidget( rb2 ); - - myTypeId = TYPE_AUTO; - /***************************************************************/ // Controls for coincident elements detecting - GroupCoincident = new QGroupBox(myAction == MERGE_ELEMENTS ? - tr("COINCIDENT_ELEMENTS") : - tr("COINCIDENT_NODES"), - this); - QVBoxLayout* aCoincidentLayout = new QVBoxLayout(GroupCoincident); + GroupCoincident = new QGroupBox(tr(isElems ? "COINCIDENT_ELEMENTS" : "COINCIDENT_NODES"), this); + + QGridLayout* aCoincidentLayout = new QGridLayout(GroupCoincident); aCoincidentLayout->setSpacing(SPACING); aCoincidentLayout->setMargin(MARGIN); if (myAction == MERGE_NODES) // case merge nodes { - QWidget* foo = new QWidget(GroupCoincident); - TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), foo); - SpinBoxTolerance = new SMESHGUI_SpinBox(foo); + /***************************************************************/ + // Node specific Controls: tolerance, ... + + NodeSpecWidget = new QWidget( this ); + + QLabel* TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), NodeSpecWidget); + SpinBoxTolerance = new SMESHGUI_SpinBox( NodeSpecWidget ); SpinBoxTolerance->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - SeparateCornersAndMedium = new QCheckBox(tr("SEPARATE_CORNERS_AND_MEDIUM"), foo); + SeparateCornersAndMedium = new QCheckBox(tr("SEPARATE_CORNERS_AND_MEDIUM"), NodeSpecWidget ); SeparateCornersAndMedium->setEnabled( false ); - GroupExclude = new QGroupBox(tr("EXCLUDE_GROUPS"), foo); - GroupExclude->setCheckable( true ); - GroupExclude->setChecked( false ); - ListExclude = new QListWidget( GroupExclude ); - QVBoxLayout* GroupExcludeLayout = new QVBoxLayout(GroupExclude); - GroupExcludeLayout->setSpacing(SPACING); - GroupExcludeLayout->setMargin(MARGIN); - GroupExcludeLayout->addWidget(ListExclude); - - QGroupBox* GroupKeep = new QGroupBox(tr("KEEP_NODES"), foo); - SelectKeepNodesButton = new QPushButton( GroupKeep ); - SelectKeepNodesButton->setIcon( IconSelect ); - QLabel* selectLabel = new QLabel(tr("SELECT")); - QRadioButton* idsButton = new QRadioButton(tr("NODE_IDS"), GroupKeep); - QRadioButton* groupButton = new QRadioButton(tr("GROUP_SUBMESH"), GroupKeep); - KeepFromButGroup = new QButtonGroup( this ); - KeepFromButGroup->addButton( idsButton, 0 ); - KeepFromButGroup->addButton( groupButton, 1 ); - groupButton->setChecked( true ); - KeepList = new QListWidget( GroupKeep ); - KeepList->setSelectionMode(QAbstractItemView::ExtendedSelection); - KeepList->setFlow(QListView::TopToBottom); - AddKeepNodesButton = new QPushButton(tr("SMESH_BUT_ADD"), GroupKeep ); - RemoveKeepNodesButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupKeep ); - QGridLayout* GroupKeepLayout = new QGridLayout(GroupKeep); - GroupKeepLayout->setSpacing( SPACING ); - GroupKeepLayout->setMargin ( MARGIN ); - GroupKeepLayout->addWidget( SelectKeepNodesButton, 0, 0 ); - GroupKeepLayout->addWidget( selectLabel, 0, 1 ); - GroupKeepLayout->addWidget( idsButton, 0, 2 ); - GroupKeepLayout->addWidget( groupButton, 0, 3, 1, 2 ); - GroupKeepLayout->addWidget( KeepList, 1, 0, 2, 4 ); - GroupKeepLayout->addWidget( AddKeepNodesButton, 1, 4, 1, 1 ); - GroupKeepLayout->addWidget( RemoveKeepNodesButton, 2, 4, 1, 1 ); - - QGridLayout* fooLayout = new QGridLayout( foo ); - fooLayout->setSpacing(SPACING); - fooLayout->setMargin(0); - fooLayout->addWidget(TextLabelTolerance, 0, 0 ); - fooLayout->addWidget(SpinBoxTolerance, 0, 1 ); - fooLayout->addWidget(SeparateCornersAndMedium, 1, 0 ); - fooLayout->addWidget(GroupExclude, 2, 0, 1, 2 ); - fooLayout->addWidget(GroupKeep, 3, 0, 1, 2 ); - aCoincidentLayout->addWidget(foo); - - // Costruction of the logical filter - QList aListOfFilters; - aListOfFilters << new SMESH_TypeFilter (SMESH::SUBMESH) - << new SMESH_TypeFilter (SMESH::GROUP); - mySubMeshOrGroupFilter = - new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR, /*takeOwnership=*/true); + AvoidMakingHoles = new QCheckBox(tr("AVOID_MAKING_HOLES"), NodeSpecWidget ); + AvoidMakingHoles->setChecked( false ); + + QGridLayout* NodeSpecLayout = new QGridLayout(NodeSpecWidget); + NodeSpecLayout->setSpacing(SPACING); + NodeSpecLayout->setMargin(0); + + NodeSpecLayout->addWidget(TextLabelTolerance, 0, 0 ); + NodeSpecLayout->addWidget(SpinBoxTolerance, 0, 1 ); + NodeSpecLayout->addWidget(SeparateCornersAndMedium, 1, 0, 1, 2 ); + NodeSpecLayout->addWidget(AvoidMakingHoles, 2, 0, 1, 2 ); } else { - TextLabelTolerance = 0; + NodeSpecWidget = 0; SpinBoxTolerance = 0; GroupExclude = 0; ListExclude = 0; KeepFromButGroup = 0; - SelectKeepNodesButton = 0; - AddKeepNodesButton = 0; - RemoveKeepNodesButton = 0; + SelectKeepButton = 0; + AddKeepButton = 0; + RemoveKeepButton = 0; KeepList = 0; mySubMeshOrGroupFilter = 0; } - GroupCoincidentWidget = new QWidget(GroupCoincident); - QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincidentWidget); - GroupCoincidentLayout->setSpacing(SPACING); - GroupCoincidentLayout->setMargin(0); + /***************************************************************/ + // Exclude groups - ListCoincident = new QListWidget(GroupCoincidentWidget); - ListCoincident->setSelectionMode(QListWidget::ExtendedSelection); + GroupExclude = new QGroupBox(tr("EXCLUDE_GROUPS"), this ); + GroupExclude->setCheckable( true ); + GroupExclude->setChecked( false ); + ListExclude = new QListWidget( GroupExclude ); + QVBoxLayout* GroupExcludeLayout = new QVBoxLayout(GroupExclude); + GroupExcludeLayout->setSpacing(SPACING); + GroupExcludeLayout->setMargin(MARGIN); + GroupExcludeLayout->addWidget(ListExclude); - DetectButton = new QPushButton(tr("DETECT"), GroupCoincidentWidget); - AddGroupButton = new QPushButton(tr("SMESH_BUT_ADD"), GroupCoincidentWidget); - RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincidentWidget); + /***************************************************************/ + // Nodes/elements to keep + + GroupKeep = new QGroupBox(tr( isElems ? "KEEP_ELEMENTS" : "KEEP_NODES"), this); + SelectKeepButton = new QPushButton( GroupKeep ); + SelectKeepButton->setIcon( IconSelect ); + QLabel* selectLabel = new QLabel(tr("SELECT")); + QRadioButton* idsButton = new QRadioButton(tr(isElems ? "SMESH_ELEMENTS" : "SMESH_NODES"), + GroupKeep); + QRadioButton* groupButton = new QRadioButton(tr("GROUP_SUBMESH"), GroupKeep); + KeepFromButGroup = new QButtonGroup( this ); + KeepFromButGroup->addButton( idsButton, 0 ); + KeepFromButGroup->addButton( groupButton, 1 ); + groupButton->setChecked( true ); + KeepList = new QListWidget( GroupKeep ); + KeepList->setSelectionMode(QAbstractItemView::ExtendedSelection); + KeepList->setFlow(QListView::TopToBottom); + AddKeepButton = new QPushButton(tr("SMESH_BUT_ADD"), GroupKeep ); + RemoveKeepButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupKeep ); + QGridLayout* GroupKeepLayout = new QGridLayout(GroupKeep); + GroupKeepLayout->setSpacing( SPACING ); + GroupKeepLayout->setMargin ( MARGIN ); + GroupKeepLayout->addWidget( SelectKeepButton, 0, 0 ); + GroupKeepLayout->addWidget( selectLabel, 0, 1 ); + GroupKeepLayout->addWidget( idsButton, 0, 2 ); + GroupKeepLayout->addWidget( groupButton, 0, 3, 1, 2 ); + GroupKeepLayout->addWidget( KeepList, 1, 0, 3, 4 ); + GroupKeepLayout->addWidget( AddKeepButton, 1, 4, 1, 1 ); + GroupKeepLayout->addWidget( RemoveKeepButton, 2, 4, 1, 1 ); + GroupKeepLayout->setRowStretch(3, 5); + + // Costruction of the logical filter + QList aListOfFilters; + aListOfFilters << new SMESH_TypeFilter (SMESH::SUBMESH) + << new SMESH_TypeFilter (SMESH::GROUP); + mySubMeshOrGroupFilter = + new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR, /*takeOwnership=*/true); + + ListCoincident = new QListWidget(GroupCoincident); + ListCoincident->setSelectionMode(QListWidget::ExtendedSelection); - SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincidentWidget); - ShowIDs = new QCheckBox(myAction == MERGE_ELEMENTS ? tr("SHOW_ELEMS_IDS") : tr("SHOW_NODES_IDS"), GroupCoincidentWidget); + DetectButton = new QPushButton(tr("DETECT"), GroupCoincident); + AddGroupButton = new QPushButton(tr("SMESH_BUT_ADD"), GroupCoincident); + RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincident); - GroupCoincidentLayout->addWidget(ListCoincident, 0, 0, 4, 2); - GroupCoincidentLayout->addWidget(DetectButton, 0, 2); - GroupCoincidentLayout->addWidget(AddGroupButton, 2, 2); - GroupCoincidentLayout->addWidget(RemoveGroupButton, 3, 2); - GroupCoincidentLayout->addWidget(SelectAllCB, 4, 0); - GroupCoincidentLayout->addWidget(ShowIDs, 4, 1); - GroupCoincidentLayout->setRowMinimumHeight(1, 10); - GroupCoincidentLayout->setRowStretch(1, 5); + SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincident); + ShowIDs = new QCheckBox( isElems ? tr("SHOW_ELEMS_IDS") : tr("SHOW_NODES_IDS"), GroupCoincident); - aCoincidentLayout->addWidget(GroupCoincidentWidget); + aCoincidentLayout->addWidget(ListCoincident, 0, 0, 4, 2); + aCoincidentLayout->addWidget(DetectButton, 0, 2); + aCoincidentLayout->addWidget(AddGroupButton, 2, 2); + aCoincidentLayout->addWidget(RemoveGroupButton, 3, 2); + aCoincidentLayout->addWidget(SelectAllCB, 4, 0); + aCoincidentLayout->addWidget(ShowIDs, 4, 1); + aCoincidentLayout->setRowMinimumHeight(1, 10); + aCoincidentLayout->setRowStretch(1, 5); /***************************************************************/ // Controls for editing the selected group - GroupEdit = new QGroupBox(tr("EDIT_SELECTED_GROUP"), this); + + GroupEdit = new QGroupBox( tr(isElems ? "EDIT_SELECTED_ELEM_GROUP" : "EDIT_SELECTED_NODE_GROUP"), this); QGridLayout* GroupEditLayout = new QGridLayout(GroupEdit); GroupEditLayout->setSpacing(SPACING); GroupEditLayout->setMargin(MARGIN); @@ -349,16 +335,50 @@ SMESHGUI_MergeDlg::SMESHGUI_MergeDlg (SMESHGUI* theModule, int theAction) GroupButtonsLayout->addWidget(buttonHelp); /***************************************************************/ - DlgLayout->addWidget(GroupConstructors); - DlgLayout->addWidget(GroupMesh); - DlgLayout->addWidget(TypeBox); - DlgLayout->addWidget(GroupCoincident); - DlgLayout->addWidget(GroupEdit); - DlgLayout->addWidget(GroupButtons); - - GroupCoincidentWidget->setVisible( myAction != MERGE_NODES ); - GroupCoincident ->setVisible( myAction == MERGE_NODES ); - //if GroupExclude->setVisible( myAction == MERGE_NODES ); + //if (myAction == MERGE_NODES) + { + QWidget* LeftWdg = new QWidget( this ); + QVBoxLayout* LeftLayout = new QVBoxLayout(LeftWdg); + LeftLayout->setSpacing(SPACING); + LeftLayout->setMargin(0); + LeftLayout->addWidget(TypeBox); + LeftLayout->addWidget(GroupMesh); + if ( !isElems ) + LeftLayout->addWidget(NodeSpecWidget); + LeftLayout->addWidget(GroupCoincident); + LeftLayout->addStretch(); + LeftLayout->addWidget(GroupButtons); + LeftLayout->setStretch( 3, 10 ); + + QWidget* RightWdg = new QWidget( this ); + QVBoxLayout* RightLayout = new QVBoxLayout(RightWdg); + RightLayout->setSpacing(SPACING); + RightLayout->setMargin(0); + RightLayout->addWidget(GroupExclude); + RightLayout->addWidget(GroupKeep); + RightLayout->addWidget(GroupEdit); + RightLayout->setStretch( 0, 4 ); + RightLayout->setStretch( 1, 5 ); + + QHBoxLayout* DlgLayout = new QHBoxLayout(this); + DlgLayout->setSpacing(SPACING*2); + DlgLayout->setMargin(MARGIN); + DlgLayout->addWidget( LeftWdg ); + DlgLayout->addWidget( RightWdg ); + } + // else + // { + // QVBoxLayout* DlgLayout = new QVBoxLayout(this); + // DlgLayout->setSpacing(SPACING); + // DlgLayout->setMargin(MARGIN); + // DlgLayout->addWidget(TypeBox); + // DlgLayout->addWidget(GroupMesh); + // DlgLayout->addWidget(GroupCoincident); + // DlgLayout->addWidget(GroupEdit); + // DlgLayout->addWidget(GroupButtons); + // } + + GroupCoincident->hide(); GroupEdit->hide(); this->resize(10,10); @@ -388,14 +408,12 @@ void SMESHGUI_MergeDlg::Init() SpinBoxTolerance->SetValue(1e-05); } - RadioButton->setChecked(true); - GroupType->button(0)->setChecked(true); myEditCurrentArgument = (QWidget*)LineEditMesh; myActor = 0; - mySubMeshOrGroup = SMESH::SMESH_subMesh::_nil(); + mySubMeshOrGroups = new SMESH::ListOfIDSources; mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector(); @@ -410,11 +428,11 @@ void SMESHGUI_MergeDlg::Init() if ( KeepList ) { - connect(SelectKeepNodesButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); - connect(KeepFromButGroup, SIGNAL (buttonClicked(int)), SLOT(onKeepNodeSourceChanged(int))); - connect(AddKeepNodesButton, SIGNAL (clicked()), this, SLOT(onAddKeepNode())); - connect(RemoveKeepNodesButton, SIGNAL (clicked()), this, SLOT(onRemoveKeepNode())); - connect(KeepList, SIGNAL (itemSelectionChanged()), this, SLOT(onSelectKeepNode())); + connect(SelectKeepButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); + connect(KeepFromButGroup, SIGNAL (buttonClicked(int)), SLOT(onKeepSourceChanged(int))); + connect(AddKeepButton, SIGNAL (clicked()), this, SLOT(onAddKeep())); + connect(RemoveKeepButton, SIGNAL (clicked()), this, SLOT(onRemoveKeep())); + connect(KeepList, SIGNAL (itemSelectionChanged()), this, SLOT(onSelectKeep())); } connect(SelectMeshButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); connect(DetectButton, SIGNAL (clicked()), this, SLOT(onDetect())); @@ -442,9 +460,9 @@ void SMESHGUI_MergeDlg::Init() updateControls(); if ( myAction == MERGE_NODES ) - myHelpFileName = "merging_nodes_page.html"; + myHelpFileName = "merging_nodes.html"; else - myHelpFileName = "merging_elements_page.html"; + myHelpFileName = "merging_elements.html"; } //================================================================================= @@ -491,7 +509,7 @@ void SMESHGUI_MergeDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap, //================================================================================= bool SMESHGUI_MergeDlg::ClickOnApply() { - if (mySMESHGUI->isActiveStudyLocked() || myMesh->_is_nil()) + if (SMESHGUI::isStudyLocked() || myMesh->_is_nil()) return false; try { @@ -519,7 +537,8 @@ bool SMESHGUI_MergeDlg::ClickOnApply() aGroupsOfElements->length(ListCoincident->count()); int anArrayNum = 0; - for (int i = 0; i < ListCoincident->count(); i++) { + for (int i = 0; i < ListCoincident->count(); i++) + { QStringList aListIds = ListCoincident->item(i)->text().split(" ", QString::SkipEmptyParts); anIds->length(aListIds.count()); @@ -529,13 +548,13 @@ bool SMESHGUI_MergeDlg::ClickOnApply() aGroupsOfElements[anArrayNum++] = anIds.inout(); } - SMESH::ListOfIDSources_var nodesToKeep; + SMESH::ListOfIDSources_var toKeep; SMESH::IDSource_wrap tmpIdSource; - if ( myAction == MERGE_NODES ) + //if ( myAction == MERGE_NODES ) { - nodesToKeep = new SMESH::ListOfIDSources(); + toKeep = new SMESH::ListOfIDSources(); int i, nb = KeepList->count(); - if ( isKeepNodesIDsSelection() ) + if ( isKeepIDsSelection() ) { SMESH::long_array_var anIdList = new SMESH::long_array(); anIdList->length(nb); @@ -545,13 +564,13 @@ bool SMESHGUI_MergeDlg::ClickOnApply() if ( nb > 0 ) { tmpIdSource = aMeshEditor->MakeIDSource( anIdList, SMESH::NODE ); - nodesToKeep->length( 1 ); - nodesToKeep[0] = SMESH::SMESH_IDSource::_duplicate( tmpIdSource.in() ); + toKeep->length( 1 ); + toKeep[0] = SMESH::SMESH_IDSource::_duplicate( tmpIdSource.in() ); } } else { - nodesToKeep->length( nb ); + toKeep->length( nb ); int nbObj = 0; for (i = 0; i < nb; i++) { @@ -561,27 +580,28 @@ bool SMESHGUI_MergeDlg::ClickOnApply() SMESH::SMESH_IDSource_var idSrc = SMESH::IObjectToInterface( anIO ); if ( !idSrc->_is_nil() ) - nodesToKeep[ nbObj++ ] = SMESH::SMESH_IDSource::_duplicate( idSrc ); + toKeep[ nbObj++ ] = SMESH::SMESH_IDSource::_duplicate( idSrc ); } - nodesToKeep->length( nbObj ); + toKeep->length( nbObj ); } KeepList->clear(); } if( myAction == MERGE_NODES ) - aMeshEditor->MergeNodes (aGroupsOfElements.inout(), nodesToKeep); + aMeshEditor->MergeNodes( aGroupsOfElements.inout(), toKeep, AvoidMakingHoles->isChecked() ); else - aMeshEditor->MergeElements (aGroupsOfElements.inout()); + aMeshEditor->MergeElements( aGroupsOfElements.inout(), toKeep ); if ( myTypeId == TYPE_AUTO ) { - if (myAction == MERGE_NODES ) + if ( myAction == MERGE_NODES ) SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INFORMATION"), tr("SMESH_MERGED_NODES").arg(QString::number(ListCoincident->count()).toLatin1().data())); else SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INFORMATION"), tr("SMESH_MERGED_ELEMENTS").arg(QString::number(ListCoincident->count()).toLatin1().data())); } - nodesToKeep->length(0); // release before tmpIdSource calls UnRegister() + if ( & toKeep.in() ) + toKeep->length(0); // release before tmpIdSource calls UnRegister() } catch(...) { @@ -726,11 +746,12 @@ void SMESHGUI_MergeDlg::updateControls() myMesh->NbVolumesOfOrder( SMESH::ORDER_QUADRATIC ) > 0 )); SeparateCornersAndMedium->setEnabled( has2ndOrder ); - + } + { if ( myEditCurrentArgument != KeepList ) { - AddKeepNodesButton->setEnabled( false ); - RemoveKeepNodesButton->setEnabled( false ); + AddKeepButton->setEnabled( false ); + RemoveKeepButton->setEnabled( false ); KeepList->clearSelection(); } } @@ -755,38 +776,38 @@ void SMESHGUI_MergeDlg::onDetect() SMESH::array_of_long_array_var aGroupsArray; SMESH::ListOfIDSources_var aExcludeGroups = new SMESH::ListOfIDSources; - SMESH::SMESH_IDSource_var src; - if ( mySubMeshOrGroup->_is_nil() ) src = SMESH::SMESH_IDSource::_duplicate( myMesh ); - else src = SMESH::SMESH_IDSource::_duplicate( mySubMeshOrGroup ); + for ( int i = 0; GroupExclude->isChecked() && i < ListExclude->count(); i++ ) { + if ( ListExclude->item( i )->checkState() == Qt::Checked ) { + aExcludeGroups->length( aExcludeGroups->length()+1 ); + aExcludeGroups[ aExcludeGroups->length()-1 ] = SMESH::SMESH_IDSource::_narrow( myGroups[i] ); + } + } switch (myAction) { case MERGE_NODES : - for ( int i = 0; GroupExclude->isChecked() && i < ListExclude->count(); i++ ) { - if ( ListExclude->item( i )->checkState() == Qt::Checked ) { - aExcludeGroups->length( aExcludeGroups->length()+1 ); - aExcludeGroups[ aExcludeGroups->length()-1 ] = SMESH::SMESH_IDSource::_duplicate( myGroups[i] ); - } - } - aMeshEditor->FindCoincidentNodesOnPartBut(src.in(), - SpinBoxTolerance->GetValue(), + aMeshEditor->FindCoincidentNodesOnPartBut(mySubMeshOrGroups.in(), + SpinBoxTolerance->GetValue(), aGroupsArray.out(), aExcludeGroups.in(), SeparateCornersAndMedium->isEnabled() && SeparateCornersAndMedium->isChecked()); break; case MERGE_ELEMENTS : - aMeshEditor->FindEqualElements(src.in(), aGroupsArray.out()); + aMeshEditor->FindEqualElements(mySubMeshOrGroups.in(), + aExcludeGroups.in(), + aGroupsArray.out()); break; } - - for (int i = 0; i < aGroupsArray->length(); i++) { + + for ( CORBA::ULong i = 0; i < aGroupsArray->length(); i++) + { SMESH::long_array& aGroup = aGroupsArray[i]; QStringList anIDs; - for (int j = 0; j < aGroup.length(); j++) - anIDs.append(QString::number(aGroup[j])); + for ( CORBA::ULong j = 0; j < aGroup.length(); j++ ) + anIDs.append( QString::number( aGroup[j] )); - ListCoincident->addItem(anIDs.join(" ")); + ListCoincident->addItem( anIDs.join(" ")); } } catch(...) { } @@ -808,6 +829,17 @@ void SMESHGUI_MergeDlg::onSelectGroup() if( ListCoincident->count() != ListCoincident->selectedItems().count() ) SelectAllCB->setChecked( false ); + if ( myEditCurrentArgument == (QWidget*)KeepList && KeepList && + !isKeepIDsSelection() ) + { + // restore selection of nodes after selection of sub-meshes + mySelectionMgr->clearFilters(); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode( NodeSelection ); + SMESH::SetPointRepresentation( true ); + myEditCurrentArgument = ListCoincident; + } + myEditCurrentArgument = (QWidget*)ListCoincident; myIsBusy = true; @@ -904,6 +936,17 @@ void SMESHGUI_MergeDlg::onSelectElementFromGroup() } else myIdPreview->SetPointsLabeled(false); + + if ( myEditCurrentArgument == (QWidget*)KeepList && KeepList && + !isKeepIDsSelection() ) + { + // restore selection of nodes after selection of sub-meshes + mySelectionMgr->clearFilters(); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode( NodeSelection ); + SMESH::SetPointRepresentation( true ); + myEditCurrentArgument = ListCoincident; + } } //================================================================================= @@ -1070,18 +1113,20 @@ void SMESHGUI_MergeDlg::SetEditCurrentArgument() if (myTypeId == TYPE_MANUAL) mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); } - else if ( send == SelectKeepNodesButton && send ) + else if ( send == SelectKeepButton && send ) { myEditCurrentArgument = (QWidget*)KeepList; - KeepList->setWrapping( isKeepNodesIDsSelection() ); - if ( isKeepNodesIDsSelection() ) + KeepList->setWrapping( isKeepIDsSelection() ); + if ( isKeepIDsSelection() ) { - SMESH::SetPointRepresentation( true ); + bool isElems = ( myAction == MERGE_ELEMENTS ); + SMESH::SetPointRepresentation( !isElems ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode( NodeSelection ); + aViewWindow->SetSelectionMode( isElems ? CellSelection : NodeSelection ); } else { + SMESH::SetPointRepresentation( false ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode( ActorSelection ); mySelectionMgr->installFilter( mySubMeshOrGroupFilter ); @@ -1099,6 +1144,9 @@ void SMESHGUI_MergeDlg::SetEditCurrentArgument() //================================================================================= void SMESHGUI_MergeDlg::SelectionIntoArgument() { + if ( myIsBusy ) + return; + if (myEditCurrentArgument == (QWidget*)LineEditMesh) { QString aString = ""; @@ -1106,12 +1154,13 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument() ListCoincident->clear(); ListEdit->clear(); + ListExclude->clear(); myActor = 0; myMesh = SMESH::SMESH_Mesh::_nil(); QString aCurrentEntry = myEntry; int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString); - if (nbSel != 1) { + if (nbSel == 0) { myIdPreview->SetPointsLabeled(false); SMESH::SetPointRepresentation(false); mySelectionMgr->clearFilters(); @@ -1133,42 +1182,78 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument() if (myMesh->_is_nil()) return; - LineEditMesh->setText(aString); - myActor = SMESH::FindActorByEntry(IO->getEntry()); if (!myActor) myActor = SMESH::FindActorByObject(myMesh); - if ( myActor && myTypeId == TYPE_MANUAL && mySelector->IsSelectionEnabled() ) { - mySubMeshOrGroup = SMESH::SMESH_IDSource::_nil(); - mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); + mySubMeshOrGroups->length( nbSel ); + nbSel = 0; + bool isMeshSelected = false; + while ( !aList.IsEmpty() ) + { + IO = aList.First(); + aList.RemoveFirst(); + SMESH::SMESH_IDSource_var idSrc = SMESH::IObjectToInterface(IO); + if ( !idSrc->_is_nil() ) + { + SMESH::SMESH_Mesh_var mesh = idSrc->GetMesh(); + if ( !mesh->_is_equivalent( myMesh )) + { + nbSel = 0; + break; + } + mySubMeshOrGroups[ nbSel++ ] = idSrc; + if ( idSrc->_is_equivalent( myMesh )) + { + isMeshSelected = true; + mySubMeshOrGroups[ 0 ] = idSrc; + aString = SMESH::GetName( IO ); + // break; -- to check if other selected belongs to myMesh + } + } + } - if ((!SMESH::IObjectToInterface(IO)->_is_nil() || //SUBMESH OR GROUP - !SMESH::IObjectToInterface(IO)->_is_nil()) && - !SMESH::IObjectToInterface(IO)->_is_nil()) - mySubMeshOrGroup = SMESH::IObjectToInterface(IO); + if ( isMeshSelected && nbSel > 1 ) + nbSel = 1; + mySubMeshOrGroups->length( nbSel ); - if (myAction == MERGE_NODES) { - SMESH::SetPointRepresentation(true); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(NodeSelection); - } - else - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + if ( nbSel == 0 ) + { + LineEditMesh->setText(""); + return; + } + + LineEditMesh->setText( aString ); + + + myIsBusy = true; // here selection can change + + if (myAction == MERGE_NODES) { + SMESH::SetPointRepresentation(true); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(NodeSelection); } + else + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(CellSelection); + + myIsBusy = false; // process groups - if ( myAction == MERGE_NODES && !myMesh->_is_nil() && myEntry != aCurrentEntry ) { - myGroups.clear(); - ListExclude->clear(); + myGroups.clear(); + ListExclude->clear(); + if ( isMeshSelected ) + { SMESH::ListOfGroups_var aListOfGroups = myMesh->GetGroups(); - for( int i = 0, n = aListOfGroups->length(); i < n; i++ ) { + GroupExclude->setEnabled( aListOfGroups->length() > 0 ); + for ( int i = 0, n = aListOfGroups->length(); i < n; i++ ) { SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i]; - if ( !aGroup->_is_nil() ) { // && aGroup->GetType() == SMESH::NODE + if ( !aGroup->_is_nil() ) { + if ( myAction == MERGE_ELEMENTS && aGroup->GetType() == SMESH::NODE ) + continue; QString aGroupName( aGroup->GetName() ); if ( !aGroupName.isEmpty() ) { - myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup)); + myGroups.append( aGroup ); QListWidgetItem* item = new QListWidgetItem( aGroupName ); item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable ); item->setCheckState( Qt::Unchecked ); @@ -1183,9 +1268,9 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument() else if (myEditCurrentArgument == (QWidget*)KeepList && KeepList) { - AddKeepNodesButton->setEnabled( false ); - RemoveKeepNodesButton->setEnabled( false ); - if ( isKeepNodesIDsSelection() ) + AddKeepButton->setEnabled( false ); + RemoveKeepButton->setEnabled( false ); + if ( isKeepIDsSelection() ) { if (!myMesh->_is_nil() && !myActor) myActor = SMESH::FindActorByObject(myMesh); @@ -1213,9 +1298,9 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument() KeepList->blockSignals(true); foreach(anItem, listItemsToSel) anItem->setSelected(true); KeepList->blockSignals(blocked); - //onSelectKeepNode(); - AddKeepNodesButton->setEnabled( nbFound < aNbNodes ); - RemoveKeepNodesButton->setEnabled( nbFound > 0 ); + //onSelectKeep(); + AddKeepButton->setEnabled( nbFound < aNbNodes ); + RemoveKeepButton->setEnabled( nbFound > 0 ); } } } @@ -1227,10 +1312,10 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument() SALOME_ListIteratorOfListIO anIt (aList); for ( ; anIt.More() && !hasNewSelected; anIt.Next()) if ( anIt.Value()->hasEntry() ) - hasNewSelected = isNewKeepNodesGroup( anIt.Value()->getEntry() ); + hasNewSelected = isNewKeepGroup( anIt.Value()->getEntry() ); - AddKeepNodesButton->setEnabled( hasNewSelected ); - //RemoveKeepNodesButton->setEnabled( KeepList->selectedItems().count() ); + AddKeepButton->setEnabled( hasNewSelected ); + //RemoveKeepButton->setEnabled( KeepList->selectedItems().count() ); } } } @@ -1241,13 +1326,17 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument() //================================================================================= void SMESHGUI_MergeDlg::DeactivateActiveDialog() { - if (GroupConstructors->isEnabled()) { - GroupConstructors->setEnabled(false); + if (TypeBox->isEnabled()) { TypeBox->setEnabled(false); GroupMesh->setEnabled(false); GroupCoincident->setEnabled(false); GroupEdit->setEnabled(false); GroupButtons->setEnabled(false); + //if (myAction == MERGE_NODES) + { + GroupExclude->setEnabled(false); + GroupKeep->setEnabled(false); + } mySMESHGUI->ResetState(); mySMESHGUI->SetActiveDialogBox(0); } @@ -1264,12 +1353,16 @@ void SMESHGUI_MergeDlg::ActivateThisDialog() { /* Emit a signal to deactivate the active dialog */ mySMESHGUI->EmitSignalDeactivateDialog(); - GroupConstructors->setEnabled(true); TypeBox->setEnabled(true); GroupMesh->setEnabled(true); GroupCoincident->setEnabled(true); GroupEdit->setEnabled(true); GroupButtons->setEnabled(true); + //if (myAction == MERGE_NODES) + { + GroupExclude->setEnabled(false); + GroupKeep->setEnabled(false); + } connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); mySMESHGUI->SetActiveDialogBox((QDialog*)this); @@ -1282,7 +1375,7 @@ void SMESHGUI_MergeDlg::ActivateThisDialog() //================================================================================= void SMESHGUI_MergeDlg::enterEvent (QEvent*) { - if ( !GroupConstructors->isEnabled() ) { + if ( !TypeBox->isEnabled() ) { SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); if ( aViewWindow && !mySelector) { mySelector = aViewWindow->GetSelector(); @@ -1323,74 +1416,70 @@ void SMESHGUI_MergeDlg::onTypeChanged (int id) myIdPreview->SetPointsLabeled(false); SMESH::SetPointRepresentation(false); + myIsBusy = true; // keep currently selected mesh if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->clearFilters(); - if (myAction == MERGE_NODES) - GroupCoincidentWidget->hide(); - else - GroupCoincident->hide(); + myIsBusy = false; + GroupCoincident->hide(); GroupEdit->hide(); + + GroupMesh->hide(); // <--- a trick to make the dialog take a minimal size + GroupMesh->show(); break; case TYPE_MANUAL: // manual SMESH::UpdateView(); - // Costruction of the logical filter - SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (SMESH::MESHorSUBMESH); - SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (SMESH::GROUP); - - QList aListOfFilters; - if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter); - if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter); - - myMeshOrSubMeshOrGroupFilter = - new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR); + myMeshOrSubMeshOrGroupFilter = new SMESH_TypeFilter (SMESH::IDSOURCE); + myIsBusy = true; // keep currently selected mesh if (myAction == MERGE_NODES) { - GroupCoincidentWidget->show(); SMESH::SetPointRepresentation(true); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if( mySelector->IsSelectionEnabled() ) aViewWindow->SetSelectionMode(NodeSelection); } else { - GroupCoincident->show(); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if( mySelector->IsSelectionEnabled() ) aViewWindow->SetSelectionMode(CellSelection); } + myIsBusy = false; + GroupCoincident->show(); GroupEdit->show(); break; } + + if ( myMesh->_is_nil() ) + SelectionIntoArgument(); + updateControls(); qApp->processEvents(); updateGeometry(); resize(10,10); - - SelectionIntoArgument(); } //======================================================================= -//function : isKeepNodesIDsSelection +//function : isKeepIDsSelection //purpose : Return true of Nodes to keep are selected by IDs //======================================================================= -bool SMESHGUI_MergeDlg::isKeepNodesIDsSelection() +bool SMESHGUI_MergeDlg::isKeepIDsSelection() { return KeepFromButGroup && KeepFromButGroup->checkedId() == 0; } //======================================================================= -//function : isNewKeepNodesGroup +//function : isNewKeepGroup //purpose : Return true if an object with given entry is NOT present in KeepList //======================================================================= -bool SMESHGUI_MergeDlg::isNewKeepNodesGroup( const char* entry ) +bool SMESHGUI_MergeDlg::isNewKeepGroup( const char* entry ) { - if ( !entry || isKeepNodesIDsSelection() ) + if ( !entry || isKeepIDsSelection() ) return false; for ( int i = 0; i < KeepList->count(); i++ ) @@ -1401,17 +1490,17 @@ bool SMESHGUI_MergeDlg::isNewKeepNodesGroup( const char* entry ) } //======================================================================= -//function : onAddKeepNode +//function : onAddKeep //purpose : SLOT called when [Add] of Nodes To Keep group is pressed //======================================================================= -void SMESHGUI_MergeDlg::onAddKeepNode() +void SMESHGUI_MergeDlg::onAddKeep() { if ( myIsBusy ) return; myIsBusy = true; - if ( isKeepNodesIDsSelection() ) + if ( isKeepIDsSelection() ) { //KeepList->clearSelection(); QString anIDs = ""; @@ -1442,9 +1531,9 @@ void SMESHGUI_MergeDlg::onAddKeepNode() KeepList->blockSignals(true); foreach(anItem, listItemsToSel) anItem->setSelected(true); KeepList->blockSignals(blocked); - //onSelectKeepNode(); + //onSelectKeep(); } - RemoveKeepNodesButton->setEnabled( aNbNodes > 0 ); + RemoveKeepButton->setEnabled( aNbNodes > 0 ); } else { @@ -1453,29 +1542,29 @@ void SMESHGUI_MergeDlg::onAddKeepNode() SALOME_ListIteratorOfListIO anIt (aList); for ( ; anIt.More(); anIt.Next()) { Handle(SALOME_InteractiveObject) anIO = anIt.Value(); - if ( isNewKeepNodesGroup( anIO->getEntry() )) + if ( isNewKeepGroup( anIO->getEntry() )) { QListWidgetItem* anItem = new QListWidgetItem( anIO->getName() ); anItem->setData( Qt::UserRole, QString( anIO->getEntry() )); KeepList->addItem(anItem); } } - //RemoveKeepNodesButton->setEnabled( KeepList->selectedItems().count() ); + //RemoveKeepButton->setEnabled( KeepList->selectedItems().count() ); } - AddKeepNodesButton->setEnabled( false ); + AddKeepButton->setEnabled( false ); myIsBusy = false; } //======================================================================= -//function : onRemoveKeepNode +//function : onRemoveKeep //purpose : SLOT called when [Remove] of Nodes To Keep group is pressed //======================================================================= -void SMESHGUI_MergeDlg::onRemoveKeepNode() +void SMESHGUI_MergeDlg::onRemoveKeep() { - // if ( isKeepNodesIDsSelection() ) + // if ( isKeepIDsSelection() ) // { // } // else @@ -1484,24 +1573,24 @@ void SMESHGUI_MergeDlg::onRemoveKeepNode() QListWidgetItem* item; foreach(item, selItems) delete item; } - if ( isKeepNodesIDsSelection() ) + if ( isKeepIDsSelection() ) { - AddKeepNodesButton->setEnabled( false ); + AddKeepButton->setEnabled( false ); } - RemoveKeepNodesButton->setEnabled( false ); + RemoveKeepButton->setEnabled( false ); } //======================================================================= -//function : onSelectKeepNode +//function : onSelectKeep //purpose : SLOT called when selection in KeepList changes //======================================================================= -void SMESHGUI_MergeDlg::onSelectKeepNode() +void SMESHGUI_MergeDlg::onSelectKeep() { if ( myIsBusy || !isEnabled() ) return; myIsBusy = true; - if ( isKeepNodesIDsSelection() ) + if ( isKeepIDsSelection() ) { if ( myActor ) { @@ -1515,25 +1604,25 @@ void SMESHGUI_MergeDlg::onSelectKeepNode() aList.Append(myActor->getIO()); mySelectionMgr->setSelectedObjects(aList,false); - AddKeepNodesButton->setEnabled( false ); - RemoveKeepNodesButton->setEnabled( aIndexes.Extent() > 0 ); + AddKeepButton->setEnabled( false ); + RemoveKeepButton->setEnabled( aIndexes.Extent() > 0 ); } } else { - RemoveKeepNodesButton->setEnabled( KeepList->selectedItems().count() ); + RemoveKeepButton->setEnabled( KeepList->selectedItems().count() ); } myIsBusy = false; } //======================================================================= -//function : onKeepNodeSourceChanged +//function : onKeepSourceChanged //purpose : SLOT called when type of source of Nodes To Keep change from // IDs to groups or vice versa //======================================================================= -void SMESHGUI_MergeDlg::onKeepNodeSourceChanged(int isGroup) +void SMESHGUI_MergeDlg::onKeepSourceChanged(int /*isGroup*/) { KeepList->clear(); - SelectKeepNodesButton->click(); + SelectKeepButton->click(); }