${PROJECT_SOURCE_DIR}/src/SUIT
${PROJECT_SOURCE_DIR}/src/Event
${PROJECT_SOURCE_DIR}/src/Style
+ ${PROJECT_SOURCE_DIR}/src/SUIT
+ ${PROJECT_SOURCE_DIR}/src/STD
+ ${PROJECT_SOURCE_DIR}/src/CAM
+ ${PROJECT_SOURCE_DIR}/src/OBJECT
+ ${PROJECT_SOURCE_DIR}/src/LightApp
${PROJECT_SOURCE_DIR}/src/SalomeApp
)
#include "SALOME_NamingService.hxx"
#include "SALOME_Event.h"
#include "SalomeApp_Engine_i.h"
+#include "LightApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include "SALOME_ListIO.hxx"
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
#include "SUIT_Study.h"
{
emitMessage(theMessage);
}
+
+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();
+}
//! Restors a visual state of the study at theSavePoint
bool restoreVisualState(CORBA::Long theSavePoint);
+ //! Get list of selected entities
+ SALOME::StringSeq* getSelection();
+
//! Emit a qt signal from the session GUI desktop window.
void emitMessage(const char* theMessage);
void emitMessageOneWay(const char* theMessage);