X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_SelectionOp.cxx;h=6992319581dfa5c7bfbf82eb7c29229d10160c5e;hp=1bc466c6a2c7d3a5fdef41355bd1da7d3f4939ae;hb=b0105f0f9d05ef09ad770cf0d343901589cba620;hpb=868e306e098d4ca6bfd1d183f0a57fb9cb805086;ds=sidebyside diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx index 1bc466c6a..699231958 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx @@ -43,6 +43,8 @@ #include CORBA_SERVER_HEADER(GEOM_Gen) #include +#include + /* Class : SMESHGUI_SelectionOp Description : Base operation for all operations using object selection in viewer or objectbrowser @@ -357,7 +359,7 @@ void SMESHGUI_SelectionOp::selected( QStringList& names, SalomeApp_Dialog::TypesList& types, QStringList& ids ) const { - SUIT_DataOwnerPtrList list; selectionMgr()->selected( list ); +/* SUIT_DataOwnerPtrList list; selectionMgr()->selected( list ); SUIT_DataOwnerPtrList::const_iterator anIt = list.begin(), aLast = list.end(); for( ; anIt!=aLast; anIt++ ) @@ -389,6 +391,37 @@ void SMESHGUI_SelectionOp::selected( QStringList& names, types.append( typeById( id, Object ) ); names.append( owner->IO()->getName() ); } + }*/ + + SALOME_ListIO selObjs; + TColStd_IndexedMapOfInteger selIndices; + selectionMgr()->selectedObjects( selObjs ); + Selection_Mode mode = selectionMode(); + EntityType objtype = mode == NodeSelection ? MeshNode : MeshElement; + + for( SALOME_ListIteratorOfListIO anIt( selObjs ); anIt.More(); anIt.Next() ) + { + selIndices.Clear(); + selectionMgr()->GetIndexes( anIt.Value(), selIndices ); + if( selIndices.Extent()==0 ) + { + QString id_str = QString( "%1%2%3" ).arg( anIt.Value()->getEntry() ).arg( idChar() ), current_id_str; + for( int i=1, n=selIndices.Extent(); i<=n; i++ ) + { + int curid = selIndices( i ); + current_id_str = id_str.arg( curid ); + ids.append( current_id_str ); + types.append( typeById( current_id_str, objtype ) ); + names.append( QString( "%1" ).arg( curid ) ); + } + } + else + { + QString id = anIt.Value()->getEntry(); + ids.append( id ); + types.append( typeById( id, Object ) ); + names.append( anIt.Value()->getName() ); + } } }