0020631: EDF 1195 SMESH : Merge Node : Optional display of the nodes of the mesh

This commit is contained in:
dmv 2010-02-11 12:08:34 +00:00
parent a0e0178a73
commit 9e7387ef24
9 changed files with 282 additions and 95 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -5,18 +5,31 @@
\n This functionality allows to merge coincident elements of a mesh \n This functionality allows to merge coincident elements of a mesh
selectable in the dialog box. selectable in the dialog box.
<ol>
<li>From the \b Modification choose \b Transformation and from its
sub-menu select the <b>Merge elements</b> item. The following dialog box
shall appear:</li>
\image html mergeelems_ico.png "Merge elements button" \image html mergeelems_ico.png "Merge elements button"
\image html mergeelems_auto.png
<li><b>Automatic mode:</b>
<ul>
<li>\b Name is the name of the mesh whose elements will be merged.</li>
<li>\b Automatic Mode or \b Manual Mode is to switch the dialog
controls type.
<li>In \b Automatic Mode the elements that were created on the same nodes will be merged.</li>
</ul>
</li><br>
\image html mergeelems.png \image html mergeelems.png
<ul>
<li>\b Name is the name of the mesh whose elements will be merged.</li> <li>If the \b Manual Mode is selected there are additional controls to
<li>\b Tolerance is a maximum distance between elements sufficient for merging. manage the elements to be merged in more detail:
<ul> <ul>
<li>\b Detect button generates the list of coincident elements for the given \b Tolerance.</li> <li>\b Detect button generates the list of coincident elements for the given \b Tolerance.</li>
</ul></li>
<li><b>Coincident elements</b> is a list of groupes of elements for <li><b>Coincident elements</b> is a list of groupes of elements for
merging. All elements of each group will form one after the operation. merging. All elements of each group will form one after the operation.
<ul> <ul>
@ -40,7 +53,7 @@ selectable in the dialog box.
<br> <br>
</li> </li>
<li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li> <li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li>
</ul> </ol>
In this picture you see a triangle which coincides with one of the In this picture you see a triangle which coincides with one of the
elements of the mesh. After we apply <b>Merge Elements</b> functionality, the elements of the mesh. After we apply <b>Merge Elements</b> functionality, the

View File

@ -11,19 +11,29 @@ with desirable tolerance, edit these groups and merge.
<ol> <ol>
<li>From the \b Modification choose \b Transformation and from its <li>From the \b Modification choose \b Transformation and from its
sub-menu select the <b>Merge nodes</b> item. The following dialog box sub-menu select the <b>Merge nodes</b> item. The following dialog box
shall appear: shall appear:</li>
\image html mergenodes_auto.png
<li><b>Automatic mode:</b>
<ul>
<li>\b Name is the name of the mesh whose nodes will be merged.</li>
<li>\b Automatic Mode or \b Manual Mode is to switch the dialog
controls type.
<li>\b Tolerance is a maximum distance between nodes sufficient for
merging, that is able in both dialog modes.</li>
<li>In \b Automatic Mode to merge the Nodes, just input the tolerance
value and confirm by \b Apply button.</li>
</ul>
</li><br>
\image html mergenodes.png \image html mergenodes.png
<ul> <li>If the \b Manual Mode is selected there are additional controls to
<li>\b Name is the name of the mesh whose nodes will be merged.</li> manage the nodes to be merged in more detail:
<li>\b Tolerance is a maximum distance between nodes sufficient for
merging.
<ul> <ul>
<li>\b Detect button generates the list of coincident nodes for the given <li>\b Detect button generates the list of coincident nodes for the given
\b Tolerance.</li> \b Tolerance.</li>
</ul>
</li>
<li><b>Coincident nodes</b> is a list of groupes of nodes for <li><b>Coincident nodes</b> is a list of groupes of nodes for
merging. All nodes of each group will form one after the merging. All nodes of each group will form one after the
operation. operation.

View File

@ -365,6 +365,24 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
GroupMeshLayout->addWidget(SelectMeshButton); GroupMeshLayout->addWidget(SelectMeshButton);
GroupMeshLayout->addWidget(LineEditMesh); GroupMeshLayout->addWidget(LineEditMesh);
/***************************************************************/
// Controls for switch dialog behaviour
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 = 0;
/***************************************************************/ /***************************************************************/
// Controls for coincident elements detecting // Controls for coincident elements detecting
GroupCoincident = new QGroupBox(myAction == 1 ? GroupCoincident = new QGroupBox(myAction == 1 ?
@ -372,41 +390,54 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
tr("COINCIDENT_NODES"), tr("COINCIDENT_NODES"),
this); this);
QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident); QVBoxLayout* aCoincidentLayout = new QVBoxLayout(GroupCoincident);
GroupCoincidentLayout->setSpacing(SPACING);
GroupCoincidentLayout->setMargin(MARGIN); GroupCoincident->setLayout(aCoincidentLayout);
QHBoxLayout* aSpinBoxLayout = new QHBoxLayout( GroupCoincident );
if (myAction == 0) { // case merge nodes if (myAction == 0) { // case merge nodes
TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), GroupCoincident); TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), GroupCoincident);
SpinBoxTolerance = new SMESHGUI_SpinBox(GroupCoincident); SpinBoxTolerance = new SMESHGUI_SpinBox(GroupCoincident);
SpinBoxTolerance->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); SpinBoxTolerance->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
GroupCoincidentLayout->addWidget(TextLabelTolerance, 0, 0); aSpinBoxLayout->addWidget(TextLabelTolerance);
GroupCoincidentLayout->addWidget(SpinBoxTolerance, 0, 1); aSpinBoxLayout->addWidget(SpinBoxTolerance);
aCoincidentLayout->addLayout(aSpinBoxLayout);
} }
else { else {
TextLabelTolerance = 0; TextLabelTolerance = 0;
SpinBoxTolerance = 0; SpinBoxTolerance = 0;
} }
int row = GroupCoincidentLayout->rowCount(); GroupCoincidentWidget = new QWidget(GroupCoincident);
QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincidentWidget);
GroupCoincidentLayout->setSpacing(SPACING);
GroupCoincidentLayout->setMargin(MARGIN);
ListCoincident = new QListWidget(GroupCoincident); ListCoincident = new QListWidget(GroupCoincidentWidget);
ListCoincident->setSelectionMode(QListWidget::ExtendedSelection); ListCoincident->setSelectionMode(QListWidget::ExtendedSelection);
DetectButton = new QPushButton(tr("DETECT"), GroupCoincident); DetectButton = new QPushButton(tr("DETECT"), GroupCoincidentWidget);
AddGroupButton = new QPushButton(tr("SMESH_BUT_ADD"), GroupCoincident); AddGroupButton = new QPushButton(tr("SMESH_BUT_ADD"), GroupCoincidentWidget);
RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincident); RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincidentWidget);
SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincident); SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincidentWidget);
GroupCoincidentLayout->addWidget(ListCoincident, row, 0, 4, 2); if (myAction == 0)
GroupCoincidentLayout->addWidget(DetectButton, row, 2); GroupCoincidentWidget->hide();
GroupCoincidentLayout->addWidget(AddGroupButton, row+2, 2); else
GroupCoincidentLayout->addWidget(RemoveGroupButton, row+3, 2); GroupCoincident->hide();
GroupCoincidentLayout->addWidget(SelectAllCB, row+4, 0, 1, 3);
GroupCoincidentLayout->setRowMinimumHeight(row+1, 10); GroupCoincidentLayout->addWidget(ListCoincident, 0, 0, 4, 2);
GroupCoincidentLayout->setRowStretch(row+1, 5); GroupCoincidentLayout->addWidget(DetectButton, 0, 2);
GroupCoincidentLayout->addWidget(AddGroupButton, 2, 2);
GroupCoincidentLayout->addWidget(RemoveGroupButton, 3, 2);
GroupCoincidentLayout->addWidget(SelectAllCB, 4, 0, 1, 3);
GroupCoincidentLayout->setRowMinimumHeight(1, 10);
GroupCoincidentLayout->setRowStretch(1, 5);
aCoincidentLayout->addWidget(GroupCoincidentWidget);
/***************************************************************/ /***************************************************************/
// Controls for editing the selected group // Controls for editing the selected group
@ -434,6 +465,8 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
GroupEditLayout->addWidget(RemoveElemButton, 0, 2); GroupEditLayout->addWidget(RemoveElemButton, 0, 2);
GroupEditLayout->addWidget(SetFirstButton, 1, 1, 1, 2); GroupEditLayout->addWidget(SetFirstButton, 1, 1, 1, 2);
GroupEdit->hide();
/***************************************************************/ /***************************************************************/
GroupButtons = new QGroupBox(this); GroupButtons = new QGroupBox(this);
QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons); QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
@ -461,10 +494,13 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
/***************************************************************/ /***************************************************************/
DlgLayout->addWidget(GroupConstructors); DlgLayout->addWidget(GroupConstructors);
DlgLayout->addWidget(GroupMesh); DlgLayout->addWidget(GroupMesh);
DlgLayout->addWidget(TypeBox);
DlgLayout->addWidget(GroupCoincident); DlgLayout->addWidget(GroupCoincident);
DlgLayout->addWidget(GroupEdit); DlgLayout->addWidget(GroupEdit);
DlgLayout->addWidget(GroupButtons); DlgLayout->addWidget(GroupButtons);
this->resize(10,10);
Init(); // Initialisations Init(); // Initialisations
} }
@ -490,6 +526,8 @@ void SMESHGUI_EditMeshDlg::Init()
RadioButton->setChecked(true); RadioButton->setChecked(true);
GroupType->button(0)->setChecked(true);
myEditCurrentArgument = (QWidget*)LineEditMesh; myEditCurrentArgument = (QWidget*)LineEditMesh;
myActor = 0; myActor = 0;
@ -500,17 +538,6 @@ void SMESHGUI_EditMeshDlg::Init()
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myIsBusy = false; myIsBusy = false;
// Costruction of the logical filter
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
@ -527,19 +554,22 @@ void SMESHGUI_EditMeshDlg::Init()
connect(AddElemButton, SIGNAL (clicked()), this, SLOT(onAddElement())); connect(AddElemButton, SIGNAL (clicked()), this, SLOT(onAddElement()));
connect(RemoveElemButton, SIGNAL (clicked()), this, SLOT(onRemoveElement())); connect(RemoveElemButton, SIGNAL (clicked()), this, SLOT(onRemoveElement()));
connect(SetFirstButton, SIGNAL( clicked() ), this, SLOT( onSetFirst() ) ); connect(SetFirstButton, SIGNAL( clicked() ), this, SLOT( onSetFirst() ) );
connect(GroupType, SIGNAL(buttonClicked(int)), this, SLOT(onTypeChanged(int)));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
SetFirstButton->setEnabled(false);
buttonOk->setEnabled(false);
buttonApply->setEnabled(false);
// Init Mesh field from selection // Init Mesh field from selection
SelectionIntoArgument(); SelectionIntoArgument();
// Update Buttons
updateControls();
if (myAction == 0)
myHelpFileName = "merging_nodes_page.html";
else
myHelpFileName = "merging_elements_page.html"; myHelpFileName = "merging_elements_page.html";
} }
@ -588,12 +618,27 @@ bool SMESHGUI_EditMeshDlg::ClickOnApply()
return false; return false;
try { try {
if (myTypeId == 0)
onDetect();
SUIT_OverrideCursor aWaitCursor; SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
SMESH::long_array_var anIds = new SMESH::long_array; SMESH::long_array_var anIds = new SMESH::long_array;
SMESH::array_of_long_array_var aGroupsOfElements = new SMESH::array_of_long_array; SMESH::array_of_long_array_var aGroupsOfElements = new SMESH::array_of_long_array;
if ( ListCoincident->count() == 0) {
if (myAction == 0)
SUIT_MessageBox::warning(this,
tr("SMESH_WARNING"),
tr("SMESH_NO_NODES_DETECTED"));
else
SUIT_MessageBox::warning(this,
tr("SMESH_WARNING"),
tr("SMESH_NO_ELEMENTS_DETECTED"));
return false;
}
aGroupsOfElements->length(ListCoincident->count()); aGroupsOfElements->length(ListCoincident->count());
int anArrayNum = 0; int anArrayNum = 0;
@ -612,12 +657,22 @@ bool SMESHGUI_EditMeshDlg::ClickOnApply()
else else
aMeshEditor->MergeElements (aGroupsOfElements.inout()); aMeshEditor->MergeElements (aGroupsOfElements.inout());
if ( myTypeId == 0 ) {
if (myAction ==0)
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()));
}
} catch(...) { } catch(...) {
} }
SMESH::UpdateView(); SMESH::UpdateView();
onDetect(); onDetect();
return true; return true;
} }
@ -706,7 +761,7 @@ void SMESHGUI_EditMeshDlg::updateControls()
{ {
if (ListEdit->count() == 0) if (ListEdit->count() == 0)
SetFirstButton->setEnabled(false); SetFirstButton->setEnabled(false);
bool enable = !(myMesh->_is_nil()) && ListCoincident->count(); bool enable = !(myMesh->_is_nil()) && (ListCoincident->count() || (myTypeId == 0));
buttonOk->setEnabled(enable); buttonOk->setEnabled(enable);
buttonApply->setEnabled(enable); buttonApply->setEnabled(enable);
} }
@ -1005,6 +1060,7 @@ void SMESHGUI_EditMeshDlg::SetEditCurrentArgument()
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
if (myTypeId == 1)
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} }
@ -1028,11 +1084,17 @@ void SMESHGUI_EditMeshDlg::SelectionIntoArgument()
myActor = 0; myActor = 0;
int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString); int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
if (nbSel != 1) if (nbSel != 1) {
myIdPreview->SetPointsLabeled(false);
SMESH::SetPointRepresentation(false);
mySelectionMgr->clearFilters();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
return; return;
}
SALOME_ListIO aList; SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type()); mySelectionMgr->selectedObjects(aList);
Handle(SALOME_InteractiveObject) IO = aList.First(); Handle(SALOME_InteractiveObject) IO = aList.First();
myMesh = SMESH::GetMeshByIO(IO); myMesh = SMESH::GetMeshByIO(IO);
@ -1040,21 +1102,21 @@ void SMESHGUI_EditMeshDlg::SelectionIntoArgument()
if (myMesh->_is_nil()) if (myMesh->_is_nil())
return; return;
LineEditMesh->setText(aString);
myActor = SMESH::FindActorByEntry(IO->getEntry()); myActor = SMESH::FindActorByEntry(IO->getEntry());
if (!myActor) if (!myActor)
myActor = SMESH::FindActorByObject(myMesh); myActor = SMESH::FindActorByObject(myMesh);
if(!myActor)
return;
if ( myActor && myTypeId ==1 ) {
mySubMeshOrGroup = SMESH::SMESH_IDSource::_nil(); mySubMeshOrGroup = SMESH::SMESH_IDSource::_nil();
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
if ((!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil() || //SUBMESH OR GROUP if ((!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil() || //SUBMESH OR GROUP
!SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO)->_is_nil()) && !SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO)->_is_nil()) &&
!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil()) !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
mySubMeshOrGroup = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO); mySubMeshOrGroup = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
LineEditMesh->setText(aString);
if (myAction == 0) { if (myAction == 0) {
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
@ -1064,6 +1126,9 @@ void SMESHGUI_EditMeshDlg::SelectionIntoArgument()
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection); aViewWindow->SetSelectionMode(CellSelection);
} }
updateControls();
}
} }
//================================================================================= //=================================================================================
@ -1074,6 +1139,7 @@ void SMESHGUI_EditMeshDlg::DeactivateActiveDialog()
{ {
if (GroupConstructors->isEnabled()) { if (GroupConstructors->isEnabled()) {
GroupConstructors->setEnabled(false); GroupConstructors->setEnabled(false);
TypeBox->setEnabled(false);
GroupMesh->setEnabled(false); GroupMesh->setEnabled(false);
GroupCoincident->setEnabled(false); GroupCoincident->setEnabled(false);
GroupEdit->setEnabled(false); GroupEdit->setEnabled(false);
@ -1095,6 +1161,7 @@ void SMESHGUI_EditMeshDlg::ActivateThisDialog()
/* Emit a signal to deactivate the active dialog */ /* Emit a signal to deactivate the active dialog */
mySMESHGUI->EmitSignalDeactivateDialog(); mySMESHGUI->EmitSignalDeactivateDialog();
GroupConstructors->setEnabled(true); GroupConstructors->setEnabled(true);
TypeBox->setEnabled(true);
GroupMesh->setEnabled(true); GroupMesh->setEnabled(true);
GroupCoincident->setEnabled(true); GroupCoincident->setEnabled(true);
GroupEdit->setEnabled(true); GroupEdit->setEnabled(true);
@ -1150,3 +1217,63 @@ void SMESHGUI_EditMeshDlg::keyPressEvent( QKeyEvent* e)
ClickOnHelp(); ClickOnHelp();
} }
} }
//=================================================================================
// function : onTypeChanged()
// purpose : the type radio button management
//=================================================================================
void SMESHGUI_EditMeshDlg::onTypeChanged (int id)
{
if (myTypeId == id)
return;
myTypeId = id;
switch (id) {
case 0:
myIdPreview->SetPointsLabeled(false);
SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->clearFilters();
if (myAction == 0)
GroupCoincidentWidget->hide();
else
GroupCoincident->hide();
GroupEdit->hide();
break;
case 1:
SMESH::UpdateView();
// Costruction of the logical filter
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
if (myAction == 0) {
GroupCoincidentWidget->show();
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
}
else {
GroupCoincident->show();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
}
GroupEdit->show();
break;
}
updateControls();
qApp->processEvents();
updateGeometry();
resize(10,10);
SelectionIntoArgument();
}

View File

@ -49,6 +49,7 @@ class QPushButton;
class QRadioButton; class QRadioButton;
class QCheckBox; class QCheckBox;
class QListWidget; class QListWidget;
class QButtonGroup;
class SMESHGUI; class SMESHGUI;
class SMESHGUI_SpinBox; class SMESHGUI_SpinBox;
class SMESH_Actor; class SMESH_Actor;
@ -102,6 +103,7 @@ private:
int myAction; int myAction;
bool myIsBusy; bool myIsBusy;
int myTypeId;
// Widgets // Widgets
QGroupBox* GroupConstructors; QGroupBox* GroupConstructors;
@ -119,6 +121,7 @@ private:
QLineEdit* LineEditMesh; QLineEdit* LineEditMesh;
QGroupBox* GroupCoincident; QGroupBox* GroupCoincident;
QWidget* GroupCoincidentWidget;
QLabel* TextLabelTolerance; QLabel* TextLabelTolerance;
SMESHGUI_SpinBox* SpinBoxTolerance; SMESHGUI_SpinBox* SpinBoxTolerance;
QPushButton* DetectButton; QPushButton* DetectButton;
@ -133,6 +136,9 @@ private:
QPushButton* RemoveElemButton; QPushButton* RemoveElemButton;
QPushButton* SetFirstButton; QPushButton* SetFirstButton;
QGroupBox* TypeBox;
QButtonGroup* GroupType;
QString myHelpFileName; QString myHelpFileName;
private slots: private slots:
@ -154,6 +160,7 @@ private:
void SelectionIntoArgument(); void SelectionIntoArgument();
void DeactivateActiveDialog(); void DeactivateActiveDialog();
void ActivateThisDialog(); void ActivateThisDialog();
void onTypeChanged(int);
}; };
#endif // SMESHGUI_EDITMESHDLG_H #endif // SMESHGUI_EDITMESHDLG_H

View File

@ -425,6 +425,7 @@
<source>MEN_MERGE_ELEMENTS</source> <source>MEN_MERGE_ELEMENTS</source>
<translation>Merge Elements</translation> <translation>Merge Elements</translation>
</message> </message>
<message> <message>
<source>MEN_MESH</source> <source>MEN_MESH</source>
<translation>Mesh</translation> <translation>Mesh</translation>
@ -1474,10 +1475,38 @@ add the exported data to its contents?</translation>
<source>SMESH_MEN_SubMeshesOnVertex</source> <source>SMESH_MEN_SubMeshesOnVertex</source>
<translation>SubMeshes On Vertex</translation> <translation>SubMeshes On Vertex</translation>
</message> </message>
<message>
<source>SMESH_AUTOMATIC</source>
<translation>Automatic</translation>
</message>
<message>
<source>SMESH_MANUAL</source>
<translation>Manual</translation>
</message>
<message> <message>
<source>SMESH_MERGE_ELEMENTS</source> <source>SMESH_MERGE_ELEMENTS</source>
<translation>Merge elements</translation> <translation>Merge elements</translation>
</message> </message>
<message>
<source>SMESH_MODE</source>
<translation>Mode</translation>
</message>
<message>
<source>SMESH_MERGED_ELEMENTS</source>
<translation>%1 elements successfully merged.</translation>
</message>
<message>
<source>SMESH_MERGED_NODES</source>
<translation>%1 nodes successfully merged.</translation>
</message>
<message>
<source>SMESH_NO_ELEMENTS_DETECTED</source>
<translation>There are no elements to merge.</translation>
</message>
<message>
<source>SMESH_NO_NODES_DETECTED</source>
<translation>There are no nodes to merge.</translation>
</message>
<message> <message>
<source>SMESH_MERGE_NODES</source> <source>SMESH_MERGE_NODES</source>
<translation>Merge nodes</translation> <translation>Merge nodes</translation>
@ -4810,6 +4839,7 @@ It is impossible to read point coordinates from file</translation>
<source>MERGE_EQUAL_ELEMENTS</source> <source>MERGE_EQUAL_ELEMENTS</source>
<translation>Merge equal elements</translation> <translation>Merge equal elements</translation>
</message> </message>
<message> <message>
<source>NODE1_TO_MERGE</source> <source>NODE1_TO_MERGE</source>
<translation>Node 1 To Merge</translation> <translation>Node 1 To Merge</translation>