From 859a8ee4f086f0c35e27687efedbcb7f89f9178f Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 30 Aug 2010 12:00:00 +0000 Subject: [PATCH] untabify --- src/SMESHGUI/SMESHGUI.cxx | 4 +- src/SMESHGUI/SMESHGUI.h | 2 +- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx | 64 +++++------ .../SMESHGUI_AddQuadraticElementDlg.cxx | 36 +++---- .../SMESHGUI_CreatePolyhedralVolumeDlg.cxx | 84 +++++++-------- src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx | 36 +++---- src/SMESHGUI/SMESHGUI_FilterDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 100 +++++++++--------- src/SMESHGUI/SMESHGUI_NodesDlg.cxx | 34 +++--- src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx | 28 ++--- src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx | 26 ++--- src/SMESH_I/SMESH_Group_i.cxx | 2 +- src/SMESH_I/SMESH_MeshEditor_i.hxx | 6 +- 13 files changed, 213 insertions(+), 213 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index ee07cc36f..d610ab3cd 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -2892,7 +2892,7 @@ void SMESHGUI::BuildPresentation( const Handle(SALOME_InteractiveObject) & theIO // purpose : //======================================================================= void SMESHGUI::createSMESHAction( const int id, const QString& po_id, const QString& icon_id, - const int key, const bool toggle, const QString& shortcutAction ) + const int key, const bool toggle, const QString& shortcutAction ) { QIcon icon; QWidget* parent = application()->desktop(); @@ -2910,7 +2910,7 @@ void SMESHGUI::createSMESHAction( const int id, const QString& po_id, const QStr status_bar = tr( QString( "STB_%1" ).arg( po_id ).toLatin1().data() ); createAction( id, tooltip, icon, menu, status_bar, key, parent, - toggle, this, SLOT( OnGUIEvent() ), shortcutAction ); + toggle, this, SLOT( OnGUIEvent() ), shortcutAction ); } //======================================================================= diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index d901ea68c..4a82e5c1a 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -146,7 +146,7 @@ protected: const QString& = QString(), const int = 0, const bool = false, - const QString& = QString() ); + const QString& = QString() ); void createPopupItem( const int, const QString&, const QString&, diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index a5d12e559..b2cd9e46d 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -492,19 +492,19 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply() if( addToGroup ) { aGroupName = ComboBox_GroupName->currentText(); for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) { - QString aName = ComboBox_GroupName->itemText( i ); - if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) ) - idx = i; + QString aName = ComboBox_GroupName->itemText( i ); + if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) ) + idx = i; } if ( idx > 0 ) { - SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] ); - if ( !aGeomGroup->_is_nil() ) { - int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ), - tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ), - tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 ); - if ( res == 1 ) return; - } - aGroup = myGroups[idx-1]; + SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] ); + if ( !aGeomGroup->_is_nil() ) { + int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ), + tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ), + tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 ); + if ( res == 1 ) return; + } + aGroup = myGroups[idx-1]; } } @@ -530,24 +530,24 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply() if ( anElemId != -1 && addToGroup && !aGroupName.isEmpty() ) { SMESH::SMESH_Group_var aGroupUsed; if ( aGroup->_is_nil() ) { - // create new group - aGroupUsed = SMESH::AddGroup( myMesh, (SMESH::ElementType)myElementType, aGroupName ); - if ( !aGroupUsed->_is_nil() ) { - myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed)); - ComboBox_GroupName->addItem( aGroupName ); - } + // create new group + aGroupUsed = SMESH::AddGroup( myMesh, (SMESH::ElementType)myElementType, aGroupName ); + if ( !aGroupUsed->_is_nil() ) { + myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed)); + ComboBox_GroupName->addItem( aGroupName ); + } } else { - SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup ); - if ( !aGeomGroup->_is_nil() ) { - aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup ); - if ( !aGroupUsed->_is_nil() && idx > 0 ) { - myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed); - SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); - } - } - else - aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup ); + SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup ); + if ( !aGeomGroup->_is_nil() ) { + aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup ); + if ( !aGroupUsed->_is_nil() && idx > 0 ) { + myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed); + SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); + } + } + else + aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup ); } if ( !aGroupUsed->_is_nil() ) { @@ -736,11 +736,11 @@ void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument() for ( int i = 0, n = aListOfGroups.length(); i < n; i++ ) { SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i]; if ( !aGroup->_is_nil() && aGroup->GetType() == (SMESH::ElementType)myElementType ) { - QString aGroupName( aGroup->GetName() ); - if ( !aGroupName.isEmpty() ) { - myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup)); - ComboBox_GroupName->addItem( aGroupName ); - } + QString aGroupName( aGroup->GetName() ); + if ( !aGroupName.isEmpty() ) { + myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup)); + ComboBox_GroupName->addItem( aGroupName ); + } } } } diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx index d190c35e3..f75dd31d8 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx @@ -731,15 +731,15 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnApply() for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) { QString aName = ComboBox_GroupName->itemText( i ); if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) ) - idx = i; + idx = i; } if ( idx > 0 ) { SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] ); if ( !aGeomGroup->_is_nil() ) { - int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ), - tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ), - tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 ); - if ( res == 1 ) return; + int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ), + tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ), + tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 ); + if ( res == 1 ) return; } aGroup = myGroups[idx-1]; } @@ -771,21 +771,21 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnApply() // create new group aGroupUsed = SMESH::AddGroup( myMesh, anElementType, aGroupName ); if ( !aGroupUsed->_is_nil() ) { - myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed)); - ComboBox_GroupName->addItem( aGroupName ); + myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed)); + ComboBox_GroupName->addItem( aGroupName ); } } else { SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup ); if ( !aGeomGroup->_is_nil() ) { - aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup ); - if ( !aGroupUsed->_is_nil() && idx > 0 ) { - myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed); - SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); - } + aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup ); + if ( !aGroupUsed->_is_nil() && idx > 0 ) { + myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed); + SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); + } } else - aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup ); + aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup ); } if ( !aGroupUsed->_is_nil() ) { @@ -974,11 +974,11 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument() for ( int i = 0, n = aListOfGroups.length(); i < n; i++ ) { SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i]; if ( !aGroup->_is_nil() && aGroup->GetType() == anElementType ) { - QString aGroupName( aGroup->GetName() ); - if ( !aGroupName.isEmpty() ) { - myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup)); - ComboBox_GroupName->addItem( aGroupName ); - } + QString aGroupName( aGroup->GetName() ); + if ( !aGroupName.isEmpty() ) { + myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup)); + ComboBox_GroupName->addItem( aGroupName ); + } } } } diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx index 864537e84..7d65ad01d 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx @@ -456,22 +456,22 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() SMESH::SMESH_GroupBase_var aGroup; int idx = 0; if( addToGroup ) { - aGroupName = ComboBox_GroupName->currentText(); - for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) { - QString aName = ComboBox_GroupName->itemText( i ); - if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) ) - idx = i; - } - if ( idx > 0 ) { - SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] ); - if ( !aGeomGroup->_is_nil() ) { - int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ), - tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ), - tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 ); - if ( res == 1 ) return; - } - aGroup = myGroups[idx-1]; - } + aGroupName = ComboBox_GroupName->currentText(); + for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) { + QString aName = ComboBox_GroupName->itemText( i ); + if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) ) + idx = i; + } + if ( idx > 0 ) { + SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] ); + if ( !aGeomGroup->_is_nil() ) { + int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ), + tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ), + tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 ); + if ( res == 1 ) return; + } + aGroup = myGroups[idx-1]; + } } if (GetConstructorId() == 0) @@ -535,28 +535,28 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() } if ( anElemId != -1 && addToGroup && !aGroupName.isEmpty() ) { - SMESH::SMESH_Group_var aGroupUsed; - if ( aGroup->_is_nil() ) { - // create new group - aGroupUsed = SMESH::AddGroup( myMesh, SMESH::VOLUME, aGroupName ); - if ( !aGroupUsed->_is_nil() ) { - myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed)); - ComboBox_GroupName->addItem( aGroupName ); - } - } - else { - SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup ); - if ( !aGeomGroup->_is_nil() ) { - aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup ); - if ( !aGroupUsed->_is_nil() && idx > 0 ) { - myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed); - SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); - } - } - else - aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup ); - } - + SMESH::SMESH_Group_var aGroupUsed; + if ( aGroup->_is_nil() ) { + // create new group + aGroupUsed = SMESH::AddGroup( myMesh, SMESH::VOLUME, aGroupName ); + if ( !aGroupUsed->_is_nil() ) { + myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed)); + ComboBox_GroupName->addItem( aGroupName ); + } + } + else { + SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup ); + if ( !aGeomGroup->_is_nil() ) { + aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup ); + if ( !aGroupUsed->_is_nil() && idx > 0 ) { + myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed); + SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); + } + } + else + aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup ); + } + if ( !aGroupUsed->_is_nil() ) { SMESH::long_array_var anIdList = new SMESH::long_array; anIdList->length( 1 ); @@ -771,10 +771,10 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::SelectionIntoArgument() for ( int i = 0, n = aListOfGroups.length(); i < n; i++ ) { SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i]; if ( !aGroup->_is_nil() && aGroup->GetType() == SMESH::VOLUME ) { - QString aGroupName( aGroup->GetName() ); - if ( !aGroupName.isEmpty() ) { - myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup)); - ComboBox_GroupName->addItem( aGroupName ); + QString aGroupName( aGroup->GetName() ); + if ( !aGroupName.isEmpty() ) { + myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup)); + ComboBox_GroupName->addItem( aGroupName ); } } } diff --git a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx index c81732323..a2a0afd9c 100644 --- a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx @@ -325,23 +325,23 @@ bool SMESHGUI_DuplicateNodesDlg::onApply() if (operationMode == 0) { if (toCreateGroup) { - SMESH::SMESH_GroupBase_ptr aNewGroup = - aMeshEditor->DoubleNodeGroupNew(myGroup1, myGroup2); - if (!CORBA::is_nil(aNewGroup)) + SMESH::SMESH_GroupBase_ptr aNewGroup = + aMeshEditor->DoubleNodeGroupNew(myGroup1, myGroup2); + if (!CORBA::is_nil(aNewGroup)) result = true; } else - result = aMeshEditor->DoubleNodeGroup(myGroup1, myGroup2); + result = aMeshEditor->DoubleNodeGroup(myGroup1, myGroup2); } else { if (toCreateGroup) { - SMESH::SMESH_GroupBase_ptr aNewGroup = - aMeshEditor->DoubleNodeElemGroupNew(myGroup1, myGroup2, myGroup3); - if (!CORBA::is_nil(aNewGroup)) - result = true; + SMESH::SMESH_GroupBase_ptr aNewGroup = + aMeshEditor->DoubleNodeElemGroupNew(myGroup1, myGroup2, myGroup3); + if (!CORBA::is_nil(aNewGroup)) + result = true; } else - result = aMeshEditor->DoubleNodeElemGroup(myGroup1, myGroup2, myGroup3); + result = aMeshEditor->DoubleNodeElemGroup(myGroup1, myGroup2, myGroup3); } } catch (const SALOME::SALOME_Exception& S_ex) { @@ -419,20 +419,20 @@ void SMESHGUI_DuplicateNodesDlg::onSelectionChanged() bool isTypeValid = true; if (operationMode == 0) { - if ( (myCurrentLineEdit == myLineEdit1 && aGroupType != SMESH::NODE) || - (myCurrentLineEdit == myLineEdit2 && aGroupType == SMESH::NODE) ) - isTypeValid = false; + if ( (myCurrentLineEdit == myLineEdit1 && aGroupType != SMESH::NODE) || + (myCurrentLineEdit == myLineEdit2 && aGroupType == SMESH::NODE) ) + isTypeValid = false; } else if (operationMode == 1) { - if ( (myCurrentLineEdit == myLineEdit1 && aGroupType != SMESH::EDGE && - aGroupType != SMESH::FACE) || - (myCurrentLineEdit == myLineEdit2 && aGroupType != SMESH::NODE) || - (myCurrentLineEdit == myLineEdit3 && aGroupType == SMESH::NODE) ) - isTypeValid = false; + if ( (myCurrentLineEdit == myLineEdit1 && aGroupType != SMESH::EDGE && + aGroupType != SMESH::FACE) || + (myCurrentLineEdit == myLineEdit2 && aGroupType != SMESH::NODE) || + (myCurrentLineEdit == myLineEdit3 && aGroupType == SMESH::NODE) ) + isTypeValid = false; } if (!isTypeValid) - aGroup = SMESH::SMESH_GroupBase::_nil(); + aGroup = SMESH::SMESH_GroupBase::_nil(); } } diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index f9b4af034..ce1a0df8b 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -2976,8 +2976,8 @@ void SMESHGUI_FilterDlg::onSelectionDone() QList types; types << SMESH::FT_BelongToGeom << SMESH::FT_BelongToPlane - << SMESH::FT_BelongToCylinder << SMESH::FT_BelongToGenSurface - << SMESH::FT_LyingOnGeom; + << SMESH::FT_BelongToCylinder << SMESH::FT_BelongToGenSurface + << SMESH::FT_LyingOnGeom; if (aList.Extent() != 1 || !myTable->CurrentCell(aRow, aCol) || !types.contains(myTable->GetCriterionType(aRow))) return; diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 860ed290d..1aab1f908 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -718,12 +718,12 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode) switch (theMode) { case grpNodeSelection: if (myActorsList.count() > 0) { - QListIterator it( myActorsList ); - while ( it.hasNext() ) - it.next()->SetPointRepresentation(true); + QListIterator it( myActorsList ); + while ( it.hasNext() ) + it.next()->SetPointRepresentation(true); } else { - SMESH::SetPointRepresentation(true); + SMESH::SetPointRepresentation(true); } if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : NodeSelection); break; @@ -805,19 +805,19 @@ bool SMESHGUI_GroupDlg::onApply() myGroup = SMESH::AddGroup(myMesh, aType, myName->text()); if ( mySelectAll->isChecked() ) { - // select all - myGroup->AddFrom(myMesh.in()); + // select all + myGroup->AddFrom(myMesh.in()); } else { - // select manually - SMESH::long_array_var anIdList = new SMESH::long_array; - int i, k = myElements->count(); - anIdList->length(k); - for (i = 0; i < k; i++) { - anIdList[i] = myElements->item(i)->text().toInt(); - } - - myGroup->Add(anIdList.inout()); + // select manually + SMESH::long_array_var anIdList = new SMESH::long_array; + int i, k = myElements->count(); + anIdList->length(k); + for (i = 0; i < k; i++) { + anIdList[i] = myElements->item(i)->text().toInt(); + } + + myGroup->Add(anIdList.inout()); } SALOMEDS::Color aColor = getGroupColor(); @@ -851,43 +851,43 @@ bool SMESHGUI_GroupDlg::onApply() } if ( mySelectAll->isChecked() ) { - // select all - myGroup->Clear(); - myGroup->AddFrom(myMesh.in()); + // select all + myGroup->Clear(); + myGroup->AddFrom(myMesh.in()); } else { - QList aAddList; - - int i, total = myElements->count(); - for (i = 0; i < total; i++) { - int anId = myElements->item(i)->text().toInt(); - int idx = myIdList.indexOf(anId); - if ( idx == -1 ) - aAddList.append(anId); - else - myIdList.removeAt(idx); - } - if (!aAddList.empty()) { - SMESH::long_array_var anIdList = new SMESH::long_array; - int added = aAddList.count(); - anIdList->length(added); - for (i = 0; i < added; i++) - anIdList[i] = aAddList[i]; - myGroup->Add(anIdList.inout()); - } - if (!myIdList.empty()) { - SMESH::long_array_var anIdList = new SMESH::long_array; - int removed = myIdList.count(); - anIdList->length(removed); - for (i = 0; i < removed; i++) - anIdList[i] = myIdList[i]; - myGroup->Remove(anIdList.inout()); - } - /* init for next operation */ - myIdList.clear(); - for (i = 0; i < total; i++) { - myIdList.append(myElements->item(i)->text().toInt()); - } + QList aAddList; + + int i, total = myElements->count(); + for (i = 0; i < total; i++) { + int anId = myElements->item(i)->text().toInt(); + int idx = myIdList.indexOf(anId); + if ( idx == -1 ) + aAddList.append(anId); + else + myIdList.removeAt(idx); + } + if (!aAddList.empty()) { + SMESH::long_array_var anIdList = new SMESH::long_array; + int added = aAddList.count(); + anIdList->length(added); + for (i = 0; i < added; i++) + anIdList[i] = aAddList[i]; + myGroup->Add(anIdList.inout()); + } + if (!myIdList.empty()) { + SMESH::long_array_var anIdList = new SMESH::long_array; + int removed = myIdList.count(); + anIdList->length(removed); + for (i = 0; i < removed; i++) + anIdList[i] = myIdList[i]; + myGroup->Remove(anIdList.inout()); + } + /* init for next operation */ + myIdList.clear(); + for (i = 0; i < total; i++) { + myIdList.append(myElements->item(i)->text().toInt()); + } } } diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index 8895cf505..2707c85d1 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -452,15 +452,15 @@ bool SMESHGUI_NodesDlg::ClickOnApply() for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) { QString aName = ComboBox_GroupName->itemText( i ); if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) ) - idx = i; + idx = i; } if ( idx > 0 ) { SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] ); if ( !aGeomGroup->_is_nil() ) { - int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ), - tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ), - tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 ); - if ( res == 1 ) return false; + int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ), + tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ), + tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 ); + if ( res == 1 ) return false; } aGroup = myGroups[idx-1]; } @@ -478,21 +478,21 @@ bool SMESHGUI_NodesDlg::ClickOnApply() // create new group aGroupUsed = SMESH::AddGroup( myMesh, SMESH::NODE, aGroupName ); if ( !aGroupUsed->_is_nil() ) { - myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed)); - ComboBox_GroupName->addItem( aGroupName ); + myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed)); + ComboBox_GroupName->addItem( aGroupName ); } } else { SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup ); if ( !aGeomGroup->_is_nil() ) { - aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup ); - if ( !aGroupUsed->_is_nil() && idx > 0 ) { - myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed); - SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); - } + aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup ); + if ( !aGroupUsed->_is_nil() && idx > 0 ) { + myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed); + SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); + } } else - aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup ); + aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup ); } if ( !aGroupUsed->_is_nil() ) { @@ -625,10 +625,10 @@ void SMESHGUI_NodesDlg::SelectionIntoArgument() 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 ) { - QString aGroupName( aGroup->GetName() ); - if ( !aGroupName.isEmpty() ) { - myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup)); - ComboBox_GroupName->addItem( aGroupName ); + QString aGroupName( aGroup->GetName() ); + if ( !aGroupName.isEmpty() ) { + myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup)); + ComboBox_GroupName->addItem( aGroupName ); } } } diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index a007feb0f..3556398a1 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -371,24 +371,24 @@ void SMESHGUI_RemoveElementsDlg::SelectionIntoArgument() myActor = SMESH::FindActorByEntry(anIO->getEntry()); if (myActor) { - - // get selected nodes - QString aString = ""; - int nbElems = SMESH::GetNameOfSelectedElements(mySelector,anIO,aString); - if (nbElems > 0) { - myBusy = true; - myEditCurrentArgument->setText(aString); - myBusy = false; - - // OK - - myNbOkElements = nbElems; - } // if (nbElems > 0) + + // get selected nodes + QString aString = ""; + int nbElems = SMESH::GetNameOfSelectedElements(mySelector,anIO,aString); + if (nbElems > 0) { + myBusy = true; + myEditCurrentArgument->setText(aString); + myBusy = false; + + // OK + + myNbOkElements = nbElems; + } // if (nbElems > 0) } // if (myActor) } // if (!myMesh->_is_nil()) } // if (nbSel == 1) { - updateButtons(); + updateButtons(); } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx index 58fd31fb3..bd2ef2188 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx @@ -377,23 +377,23 @@ void SMESHGUI_RemoveNodesDlg::SelectionIntoArgument() myActor = SMESH::FindActorByEntry(anIO->getEntry()); if (myActor) { - // get selected nodes - QString aString = ""; - int nbNodes = SMESH::GetNameOfSelectedNodes(mySelector,anIO,aString); - if (nbNodes > 0) { - myBusy = true; - myEditCurrentArgument->setText(aString); - myBusy = false; - - // OK - - myNbOkNodes = nbNodes; - } // if (nbNodes > 0) + // get selected nodes + QString aString = ""; + int nbNodes = SMESH::GetNameOfSelectedNodes(mySelector,anIO,aString); + if (nbNodes > 0) { + myBusy = true; + myEditCurrentArgument->setText(aString); + myBusy = false; + + // OK + + myNbOkNodes = nbNodes; + } // if (nbNodes > 0) } // if (myActor) } // if (!myMesh->_is_nil()) } // if (nbSel == 1) - updateButtons(); + updateButtons(); } //================================================================================= diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index 5b0f5062f..d6f2d4ee4 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -354,7 +354,7 @@ CORBA::Long SMESH_Group_i::AddFrom( SMESH::SMESH_IDSource_ptr theSource ) if (aGroupDS) { SMESH::long_array_var anIds; if ( !CORBA::is_nil(SMESH::SMESH_GroupBase::_narrow(theSource)) && - SMESH::SMESH_GroupBase::_narrow(theSource)->GetType() == GetType() ) { + SMESH::SMESH_GroupBase::_narrow(theSource)->GetType() == GetType() ) { anIds = theSource->GetIDs(); } else if ( !CORBA::is_nil(SMESH::SMESH_Mesh::_narrow(theSource)) ) { diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index 281394374..8228af756 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -561,7 +561,7 @@ public: * \sa DoubleNodeGroup() */ SMESH::SMESH_Group_ptr DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes, - SMESH::SMESH_GroupBase_ptr theModifiedElems ); + SMESH::SMESH_GroupBase_ptr theModifiedElems ); CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes, const SMESH::ListOfGroups& theModifiedElems); @@ -619,8 +619,8 @@ public: * \sa DoubleNodeElemGroup() */ SMESH::SMESH_Group_ptr DoubleNodeElemGroupNew( SMESH::SMESH_GroupBase_ptr theElems, - SMESH::SMESH_GroupBase_ptr theNodesNot, - SMESH::SMESH_GroupBase_ptr theAffectedElems ); + SMESH::SMESH_GroupBase_ptr theNodesNot, + SMESH::SMESH_GroupBase_ptr theAffectedElems ); /*! * \brief Creates a hole in a mesh by doubling the nodes of some particular elements -- 2.39.2