- SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array;
- anArrayOfIdeces->length(myNbNodes);
- bool reverse = (Reverse && Reverse->isChecked());
- QStringList aListId = QStringList::split(" ", myEditCurrentArgument->text(), false);
- for (int i = 0; i < aListId.count(); i++)
- if (reverse)
- anArrayOfIdeces[i] = aListId[ myNbNodes - i - 1 ].toInt();
- else
- anArrayOfIdeces[i] = aListId[ i ].toInt();
+ QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
+ SMESH::long_array_var anArrayOfIndices = new SMESH::long_array;
+ anArrayOfIndices->length(aListId.count());
+ const std::vector<int>& revIndex = SMDS_MeshCell::reverseSmdsOrder( myGeomType );
+ if ( ReverseOrDulicate && ReverseOrDulicate->isChecked() && (int)revIndex.size() == aListId.count() )
+ for (int i = 0; i < aListId.count(); i++)
+ anArrayOfIndices[i] = aListId[ revIndex[i] ].toInt();
+ else if ( ReverseOrDulicate && ReverseOrDulicate->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;
+ }
+ SMESH::SMESH_GroupOnFilter_var aFilterGroup = SMESH::SMESH_GroupOnFilter::_narrow( myGroups[idx-1] );
+ if ( !aFilterGroup->_is_nil() ) {
+ int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ),
+ tr( "MESH_FILTER_GRP_CHOSEN" ).arg( aGroupName ),
+ tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 );
+ if ( res == 1 ) return;
+ }
+ aGroup = myGroups[idx-1];
+ }
+ }