2 #include "SalomeApp_Selection.h"
4 #include "SalomeApp_SelectionMgr.h"
5 #include "SalomeApp_DataOwner.h"
6 #include "SalomeApp_Study.h"
7 #include "SalomeApp_Application.h"
9 #include "SUIT_Session.h"
11 SalomeApp_Selection::SalomeApp_Selection()
16 SalomeApp_Selection::~SalomeApp_Selection()
20 void SalomeApp_Selection::init( const QString& client, SalomeApp_SelectionMgr* mgr)
22 myPopupClient = client;
26 if ( mgr->application() )
27 myStudy = dynamic_cast<SalomeApp_Study*>( mgr->application()->activeStudy() );
29 SUIT_DataOwnerPtrList sel;
31 SUIT_DataOwnerPtrList::const_iterator anIt = sel.begin(), aLast = sel.end();
32 for( ; anIt!=aLast; anIt++ )
34 SUIT_DataOwner* owner = ( SUIT_DataOwner* )( (*anIt ).get() );
35 SalomeApp_DataOwner* sowner = dynamic_cast<SalomeApp_DataOwner*>( owner );
37 myEntries.append( sowner->entry() );
38 processOwner( sowner );
44 int SalomeApp_Selection::count() const
46 return myEntries.count();
49 QtxValue SalomeApp_Selection::param( const int ind, const QString& p ) const
57 void SalomeApp_Selection::processOwner( const SalomeApp_DataOwner* )
61 QString SalomeApp_Selection::entry( const int index ) const
63 if ( index >= 0 && index < count() )
64 return myEntries[ index ];