+
+SALOME::StringSeq* SALOME_Session_i::getSelection()
+{
+ SALOME::StringSeq_var selection = new SALOME::StringSeq;
+ _GUIMutex->lock();
+ if ( SUIT_Session::session() ) {
+ LightApp_Application* app = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
+ if ( app ) {
+ LightApp_SelectionMgr* selMgr = dynamic_cast<LightApp_SelectionMgr*>( app->selectionMgr() );
+ SALOME_ListIO selected;
+ selMgr->selectedObjects( selected );
+ selection->length( selected.Extent() );
+ int nbSel = 0;
+ for ( SALOME_ListIteratorOfListIO it( selected ); it.More(); it.Next() ) {
+ Handle( SALOME_InteractiveObject ) io = it.Value();
+ if ( io->hasEntry() )
+ selection[nbSel++] = CORBA::string_dup( io->getEntry() );
+ }
+ selection->length( nbSel );
+ }
+ }
+ _GUIMutex->unlock();
+ return selection._retn();
+}