-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 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
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESHGUI : GUI for SMESH component
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
SMESH::ListOfGroups_var g1 = new SMESH::ListOfGroups();
g1->length( myGroups1.count() );
for ( int i = 0; i < myGroups1.count(); i++ )
- g1[i] = myGroups1[i];
+ g1[i] = myGroups1[i];
SMESH::ListOfGroups_var g2 = new SMESH::ListOfGroups();
g2->length( myGroups2.count() );
for ( int i = 0; i < myGroups2.count(); i++ )
- g2[i] = myGroups2[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 );
+ result = !CORBA::is_nil( aNewGroup );
}
else {
result = aMeshEditor->DoubleNodeGroups( g1.in(), g2.in() );
SMESH::ListOfGroups_var g1 = new SMESH::ListOfGroups();
g1->length( myGroups1.count() );
for ( int i = 0; i < myGroups1.count(); i++ )
- g1[i] = myGroups1[i];
+ g1[i] = myGroups1[i];
SMESH::ListOfGroups_var g2 = new SMESH::ListOfGroups();
g2->length( myGroups2.count() );
for ( int i = 0; i < myGroups2.count(); i++ )
- g2[i] = myGroups2[i];
+ g2[i] = myGroups2[i];
SMESH::ListOfGroups_var g3 = new SMESH::ListOfGroups();
g3->length( myGroups3.count() );
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 );
+ g3[i] = myGroups3[i];
+ 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() );
SALOME_ListIO aList;
mySelectionMgr->selectedObjects( aList );
- int aNbSel = aList.Extent();
+ //int aNbSel = aList.Extent();
QList<SMESH::SMESH_GroupBase_var> aGroups;
if ( ok ) {
SMESH::ElementType aGroupType = aGroup->GetType();
if ( operationMode == 0 ) {
- ok = ( myCurrentLineEdit == myLineEdit1 && aGroupType == SMESH::NODE ) ||
- ( myCurrentLineEdit == myLineEdit2 && aGroupType != SMESH::NODE );
+ ok = ( myCurrentLineEdit == myLineEdit1 && aGroupType == SMESH::NODE ) ||
+ ( myCurrentLineEdit == myLineEdit2 && aGroupType != SMESH::NODE );
}
else {
- ok = ( myCurrentLineEdit == myLineEdit1 && ( aGroupType == SMESH::EDGE ||
- aGroupType == SMESH::FACE ) ) ||
- ( myCurrentLineEdit == myLineEdit2 && aGroupType == SMESH::NODE ) ||
- ( myCurrentLineEdit == myLineEdit3 && aGroupType != SMESH::NODE );
+ ok = ( myCurrentLineEdit == myLineEdit1 && ( aGroupType == SMESH::EDGE ||
+ aGroupType == SMESH::FACE ) ) ||
+ ( myCurrentLineEdit == myLineEdit2 && aGroupType == SMESH::NODE ) ||
+ ( myCurrentLineEdit == myLineEdit3 && aGroupType != SMESH::NODE );
}
}
if ( ok ) aGroups << aGroup;
if ( myCurrentLineEdit == myLineEdit1 ) myGroups1 = aGroups;
else if ( myCurrentLineEdit == myLineEdit2 ) myGroups2 = aGroups;
else if ( myCurrentLineEdit == myLineEdit3 ) myGroups3 = aGroups;
- myCurrentLineEdit->setText( aGroups.count() == 1 ? aGroups[0]->GetName() :
- QObject::tr( "SMESH_OBJECTS_SELECTED" ).arg( aGroups.count() ) );
+ CORBA::String_var name = aGroups[0]->GetName();
+ myCurrentLineEdit->setText( aGroups.count() == 1 ? QString(name).trimmed() :
+ QObject::tr( "SMESH_OBJECTS_SELECTED" ).arg( aGroups.count() ) );
}
else {
if ( myCurrentLineEdit == myLineEdit1 ) myGroups1.clear();