+ SMESH::long_array_var anArrayOfIndices = new SMESH::long_array;
+ anArrayOfIndices->length(aListId.count());
+ const std::vector<int>& revIndex = SMDS_MeshCell::reverseSmdsOrder( myGeomType );
+ if ( Reverse && Reverse->isChecked() && !revIndex.empty() )
+ for (int i = 0; i < aListId.count(); i++)
+ anArrayOfIndices[i] = aListId[ revIndex[i] ].toInt();
+ else if ( Reverse && Reverse->isChecked() && revIndex.empty() ) // polygon
+ for (int i = 0; i < aListId.count(); i++)
+ anArrayOfIndices[i] = aListId[ aListId.count()-1 - i ].toInt();
+ else
+ for (int i = 0; i < aListId.count(); i++)
+ anArrayOfIndices[i] = aListId[ i ].toInt();
+
+ bool addToGroup = GroupGroups->isChecked();
+ QString aGroupName;
+
+ 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 && idx <= myGroups.count() ) {
+ 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];
+ }
+ }