From: mpv Date: Wed, 27 Dec 2006 07:52:02 +0000 (+0000) Subject: MPV NPAL13114: for OCCViewer we have to store not-displayed selected objects also... X-Git-Tag: V3_2_5pre1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c80d068c9c033fe75e054f3671f7523ea8dbde0f;p=modules%2Fgeom.git MPV NPAL13114: for OCCViewer we have to store not-displayed selected objects also. They are stored in mySelectedExternals field. It is filled in setSelected by not-displayed objects and it is appended to getSelected result list. --- diff --git a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx index 3db11fd4e..dd3eeb378 100644 --- a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx +++ b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx @@ -126,6 +126,12 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const } } } + // add externally selected objects + SUIT_DataOwnerPtrList::const_iterator anExtIter; + for(anExtIter = mySelectedExternals.begin(); anExtIter != mySelectedExternals.end(); anExtIter++) { + aList.append(*anExtIter); + } + } //================================================================ @@ -245,6 +251,7 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) if ( !anOwner->ComesFromDecomposition() && globalSelMap.contains( entryStr ) ) { ownersmap.Add( anOwner ); + globalSelMap[entryStr]++; } // LOCAL selection else @@ -289,4 +296,20 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) } vw->update(); + + // fill extra selected + mySelectedExternals.clear(); + for ( SUIT_DataOwnerPtrList::const_iterator itr2 = aList.begin(); itr2 != aList.end(); ++itr2 ) { + const LightApp_DataSubOwner* subOwner = dynamic_cast( (*itr2).operator->() ); + if ( !subOwner ) + { + const LightApp_DataOwner* owner = dynamic_cast( (*itr2).operator->() ); + if ( owner ) + { + SalomeApp_Study* appStudy = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + QString anEntry = appStudy->referencedToEntry( owner->entry() ); + if (globalSelMap[anEntry] == 1) mySelectedExternals.append(*itr2); + } + } + } }