From: apo Date: Tue, 18 Oct 2005 15:10:35 +0000 (+0000) Subject: Patch on Bug GVIEW10227 X-Git-Tag: TG-D5-38-2003_D2005-29-12~56 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0d7c7c31766924291220824a25647f943b2b5728;p=modules%2Fgui.git Patch on Bug GVIEW10227 Highlighted group of elements remains in 3D viewer. --- diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index 43d8236af..646344064 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -254,36 +254,6 @@ SALOME_Actor } -//---------------------------------------------------------------------------- -bool -SALOME_Actor -::hasHighlight() -{ - return false; -} - -void -SALOME_Actor -::highlight(bool theHighlight) -{ - highlight(theHighlight,mySelectionMode); -} - -bool -SALOME_Actor -::isHighlighted() -{ - return myIsHighlighted; -} - -void -SALOME_Actor -::SetPreSelected(bool thePreselect) -{ - myIsPreselected = thePreselect; -} - - //---------------------------------------------------------------------------- void SALOME_Actor @@ -729,79 +699,103 @@ SALOME_Actor Superclass::SetVisibility( theVisibility ); myOutlineActor->SetVisibility( theVisibility && isHighlighted() && !hasHighlight() ); - myHighlightActor->SetVisibility( theVisibility && isHighlighted() ); + myPreHighlightActor->SetVisibility( theVisibility && myIsPreselected ); + + if(mySelector.GetPointer()){ + if(mySelector->SelectionMode() != ActorSelection){ + int aHasIndex = mySelector->HasIndex( getIO() ); + myHighlightActor->SetVisibility( theVisibility && isHighlighted() && aHasIndex); + } + } } -//---------------------------------------------------------------- +//---------------------------------------------------------------------------- +bool +SALOME_Actor +::hasHighlight() +{ + return false; +} + +bool +SALOME_Actor +::isHighlighted() +{ + return myIsHighlighted; +} + void SALOME_Actor -::highlight(bool theHighlight, - Selection_Mode theSelectionMode) -{ - myHighlightActor->SetVisibility( false ); - myOutlineActor->SetVisibility( false ); +::SetPreSelected(bool thePreselect) +{ + myIsPreselected = thePreselect; +} - if(hasHighlight() && theSelectionMode == ActorSelection) - highlight(theHighlight); - else{ - myIsHighlighted = theHighlight; - - if( !GetVisibility() ) - return; - - if(theSelectionMode != ActorSelection) - myHighlightActor->SetVisibility( theHighlight ); - myOutline->SetBounds( GetInput()->GetBounds() ); - myOutlineActor->SetVisibility( theHighlight ); - } +//---------------------------------------------------------------- +void +SALOME_Actor +::SetSelector(SVTK_Selector* theSelector) +{ + mySelector = theSelector; } void SALOME_Actor -::highlight(bool theIsHighlight, - SVTK_Selector* theSelector) +::Highlight(bool theIsHighlight) { - TColStd_IndexedMapOfInteger aMapIndex; - theSelector->GetIndex( getIO(), aMapIndex ); - mySelectionMode = theSelector->SelectionMode(); + mySelectionMode = mySelector->SelectionMode(); + myHighlightActor->SetVisibility( false ); + myOutlineActor->SetVisibility( false ); if(MYDEBUG) MESSAGE("SALOME_Actor::highlight - this = "<Initialize(anIteractor->GetDevice(),aSelector); + SVTK_GenericRenderWindowInteractor* aDevice = SVTK_GenericRenderWindowInteractor::New(); aDevice->SetRenderWidget(anIteractor);