+//================================================================================
+/*!
+ * \brief create groups of bad mesh elements preventing computation of a submesh of current row
+ */
+//================================================================================
+
+void SMESHGUI_BaseComputeOp::onGroupOfBadMesh()
+{
+ QList<int> rows;
+ SMESH::getSelectedRows( table(), rows );
+ int row;
+ foreach ( row, rows )
+ {
+ bool hasBadMesh = ( !table()->item(row, COL_BAD_MESH)->text().isEmpty() );
+ if ( hasBadMesh ) {
+ int curSub = table()->item(rows.front(), COL_SHAPEID)->text().toInt();
+ QString grName = table()->item(rows.front(), COL_SHAPE)->text();
+ if ( grName.isEmpty() ) grName = "bad mesh";
+ else grName = "bad mesh of " + grName;
+ SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
+ SMESH::ListOfGroups_var groups
+ ( gen->MakeGroupsOfBadInputElements(myMesh,curSub,grName.toLatin1().data()) );
+ update( UF_ObjBrowser | UF_Model );
+ if( LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( application() ))
+ {
+ QStringList anEntryList;
+ for ( size_t i = 0; i < groups->length(); ++i )
+ if ( _PTR(SObject) so = SMESH::FindSObject( groups[i] ))
+ anEntryList.append( so->GetID().c_str() );
+
+ if ( !anEntryList.isEmpty())
+ anApp->browseObjects( anEntryList, true, false );
+ }
+ }
+ }
+}
+