myLineEdit3 = new QLineEdit(myGroupArguments);
myLineEdit3->setReadOnly(true);
- myCheckBoxNewGroup = new QCheckBox(tr("CONSTRUCT_NEW_GROUP_NODES"), myGroupArguments);
+ myCheckBoxNewElemGroup = new QCheckBox(tr("CONSTRUCT_NEW_GROUP_ELEMENTS"), myGroupArguments);
+ myCheckBoxNewNodeGroup = new QCheckBox(tr("CONSTRUCT_NEW_GROUP_NODES"), myGroupArguments);
aGroupArgumentsLayout->addWidget(myTextLabel1, 0, 0);
aGroupArgumentsLayout->addWidget(mySelectButton1, 0, 1);
aGroupArgumentsLayout->addWidget(myTextLabel3, 2, 0);
aGroupArgumentsLayout->addWidget(mySelectButton3, 2, 1);
aGroupArgumentsLayout->addWidget(myLineEdit3, 2, 2);
- aGroupArgumentsLayout->addWidget(myCheckBoxNewGroup, 3, 0);
- aGroupArgumentsLayout->setRowStretch(4, 1);
+ aGroupArgumentsLayout->addWidget(myCheckBoxNewElemGroup, 3, 0);
+ aGroupArgumentsLayout->addWidget(myCheckBoxNewNodeGroup, 4, 0);
+ aGroupArgumentsLayout->setRowStretch(5, 1);
// Buttons
QGroupBox* aGroupButtons = new QGroupBox(this);
void SMESHGUI_DuplicateNodesDlg::Init()
{
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
- myCheckBoxNewGroup->setChecked(true);
+ myCheckBoxNewElemGroup->setChecked(true);
+ myCheckBoxNewNodeGroup->setChecked(true);
// Set initial parameters
myBusy = false;
myTextLabel1->setText(tr("GROUP_NODES_TO_DUPLICATE"));
myTextLabel2->setText(tr("GROUP_NODES_TO_REPLACE"));
- // Set checkbox title
- myCheckBoxNewGroup->setText(tr("CONSTRUCT_NEW_GROUP_NODES"));
+ myCheckBoxNewElemGroup->hide();
+ myCheckBoxNewNodeGroup->show();
// Hide the third field
myTextLabel3->hide();
myTextLabel2->setText(tr("GROUP_NODES_NOT_DUPLICATE"));
myTextLabel3->setText(tr("GROUP_ELEMS_TO_REPLACE"));
- // Set checkbox title
- myCheckBoxNewGroup->setText(tr("CONSTRUCT_NEW_GROUP_ELEMENTS"));
+ myCheckBoxNewElemGroup->show();
+ myCheckBoxNewNodeGroup->show();
// Show the third field
myTextLabel3->show();
BusyLocker lock( myBusy );
- bool toCreateGroup = myCheckBoxNewGroup->isChecked();
+ bool toCreateElemGroup = myCheckBoxNewElemGroup->isChecked();
+ bool toCreateNodeGroup = myCheckBoxNewNodeGroup->isChecked();
int operationMode = myGroupConstructors->checkedId();
// Apply changes
for ( int i = 0; i < myGroups2.count(); i++ )
g2[i] = myGroups2[i];
- if ( toCreateGroup ) {
+ if ( toCreateNodeGroup ) {
SMESH::SMESH_GroupBase_var aNewGroup =
aMeshEditor->DoubleNodeGroupsNew( g1.in(), g2.in() );
result = !CORBA::is_nil( aNewGroup );
for ( int i = 0; i < myGroups3.count(); i++ )
g3[i] = myGroups3[i];
- if ( toCreateGroup ) {
- SMESH::SMESH_GroupBase_ptr aNewGroup =
- aMeshEditor->DoubleNodeElemGroupsNew( g1.in(), g2.in(), g3.in() );
- result = !CORBA::is_nil( aNewGroup );
+ if ( toCreateElemGroup || toCreateNodeGroup ) {
+ SMESH::ListOfGroups_var aNewGroups =
+ aMeshEditor->DoubleNodeElemGroups2New( g1.in(), g2.in(), g3.in(),
+ toCreateElemGroup, toCreateNodeGroup );
+ result = ( aNewGroups[ !toCreateElemGroup ].in() );
}
else {
result = aMeshEditor->DoubleNodeElemGroups( g1.in(), g2.in(), g3.in() );