From 4d12bf0f3e8e01a57ac9e8fdfd3937c638a23ac6 Mon Sep 17 00:00:00 2001 From: ptv Date: Tue, 12 Dec 2006 07:53:54 +0000 Subject: [PATCH] debug show/hide on invisible objects --- src/LightApp/LightApp_GLSelector.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/LightApp/LightApp_GLSelector.cxx b/src/LightApp/LightApp_GLSelector.cxx index d7c14c59b..44f458ad4 100644 --- a/src/LightApp/LightApp_GLSelector.cxx +++ b/src/LightApp/LightApp_GLSelector.cxx @@ -63,7 +63,7 @@ void LightApp_GLSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const for ( cont->InitSelected(); cont->MoreSelected(); cont->NextSelected() ) { GLViewer_Object* obj = cont->SelectedObject(); - if ( obj ) + if ( obj && obj->getVisible() ) // get only visible obejct as selected from GL-viewer { LightApp_DataOwner* owner = dynamic_cast( obj->owner() ); if ( owner ) @@ -96,15 +96,19 @@ void LightApp_GLSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) for ( ObjList::const_iterator it = displayed.begin(); it != displayed.end(); ++it ) { GLViewer_Object* obj = *it; - if ( obj && obj->getVisible() ) + if ( obj ) { LightApp_DataOwner* owner = dynamic_cast( obj->owner() ); bool sel = owner && aSelected.contains( owner->entry() ); - changed = changed || sel != (bool)obj->isSelected(); - if ( sel && !obj->isSelected() ) - cont->setSelected( obj, false ); - else if ( !sel && obj->isSelected() ) - cont->remSelected( obj, false ); + if ( !sel || obj->getVisible() ) + { + // select only visible object. deselect any + changed = changed || sel != (bool)obj->isSelected(); + if ( sel && !obj->isSelected() ) + cont->setSelected( obj, false ); + else if ( !sel && obj->isSelected() ) + cont->remSelected( obj, false ); + } } } -- 2.39.2