X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSMESHGUI%2FSMESHGUI_SelectionOp.cxx;h=1111be4075be7376fda3e9729dc30054c823391a;hb=5372a02307c639098f8f53c67c62aea685301c63;hp=6992319581dfa5c7bfbf82eb7c29229d10160c5e;hpb=b0105f0f9d05ef09ad770cf0d343901589cba620;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx index 699231958..1111be407 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx @@ -29,9 +29,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -48,7 +48,7 @@ /* Class : SMESHGUI_SelectionOp Description : Base operation for all operations using object selection in viewer or objectbrowser - through common widgets created by SalomeApp_Dialog::createObject + through common widgets created by LightApp_Dialog::createObject */ //================================================================================= @@ -101,7 +101,7 @@ void SMESHGUI_SelectionOp::startOperation() //================================================================================= void SMESHGUI_SelectionOp::removeCustomFilters() const { - SalomeApp_SelectionMgr* mgr = selectionMgr(); + LightApp_SelectionMgr* mgr = selectionMgr(); if( !mgr ) return; @@ -156,7 +156,7 @@ void SMESHGUI_SelectionOp::selectionDone() } QStringList names, ids; - SalomeApp_Dialog::TypesList types; + LightApp_Dialog::TypesList types; selected( names, types, ids ); dlg()->selectObject( names, types, ids ); } @@ -176,7 +176,7 @@ SUIT_SelectionFilter* SMESHGUI_SelectionOp::createFilter( const int ) const //================================================================================= void SMESHGUI_SelectionOp::onActivateObject( int id ) { - SalomeApp_SelectionMgr* mgr = selectionMgr(); + LightApp_SelectionMgr* mgr = selectionMgr(); if( !mgr ) return; @@ -195,7 +195,7 @@ void SMESHGUI_SelectionOp::onActivateObject( int id ) //================================================================================= void SMESHGUI_SelectionOp::onDeactivateObject( int id ) { - SalomeApp_SelectionMgr* mgr = selectionMgr(); + LightApp_SelectionMgr* mgr = selectionMgr(); if( mgr && myFilters.contains( id ) && myFilters[ id ] ) mgr->removeFilter( myFilters[ id ] ); } @@ -356,7 +356,7 @@ int SMESHGUI_SelectionOp::typeById( const QString& str, const EntityType objtype // Purpose : Get names, types and ids of selected objects //======================================================================= void SMESHGUI_SelectionOp::selected( QStringList& names, - SalomeApp_Dialog::TypesList& types, + LightApp_Dialog::TypesList& types, QStringList& ids ) const { /* SUIT_DataOwnerPtrList list; selectionMgr()->selected( list ); @@ -364,8 +364,8 @@ void SMESHGUI_SelectionOp::selected( QStringList& names, aLast = list.end(); for( ; anIt!=aLast; anIt++ ) { - SalomeApp_DataOwner* owner = dynamic_cast( (*anIt).operator->() ); - SalomeApp_SVTKDataOwner* vtkowner = dynamic_cast( (*anIt).operator->() ); + LightApp_DataOwner* owner = dynamic_cast( (*anIt).operator->() ); + LightApp_SVTKDataOwner* vtkowner = dynamic_cast( (*anIt).operator->() ); if( vtkowner ) { @@ -403,7 +403,7 @@ void SMESHGUI_SelectionOp::selected( QStringList& names, { selIndices.Clear(); selectionMgr()->GetIndexes( anIt.Value(), selIndices ); - if( selIndices.Extent()==0 ) + 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++ ) @@ -420,7 +420,13 @@ void SMESHGUI_SelectionOp::selected( QStringList& names, QString id = anIt.Value()->getEntry(); ids.append( id ); types.append( typeById( id, Object ) ); - names.append( anIt.Value()->getName() ); + SalomeApp_Study* _study = dynamic_cast( study() ); + if( _study ) + { + _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() ); + if( obj ) + names.append( obj->GetName().c_str() ); + } } } } @@ -491,7 +497,7 @@ void SMESHGUI_SelectionOp::onTextChanged( int, const QStringList& list ) selector()->AddOrRemoveIndex( sel.First(), newIndices, false ); highlight( sel.First(), true, true ); - QStringList names, _ids; SalomeApp_Dialog::TypesList types; + QStringList names, _ids; LightApp_Dialog::TypesList types; selected( names, types, _ids ); dlg()->selectObject( names, types, _ids, false ); }