From 0d7c7c31766924291220824a25647f943b2b5728 Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 18 Oct 2005 15:10:35 +0000 Subject: [PATCH] Patch on Bug GVIEW10227 Highlighted group of elements remains in 3D viewer. --- src/SVTK/SALOME_Actor.cxx | 219 +++++++++++------------ src/SVTK/SALOME_Actor.h | 72 ++++---- src/SVTK/SVTK_InteractorStyle.cxx | 8 +- src/SVTK/SVTK_RenderWindowInteractor.cxx | 8 +- src/SVTK/SVTK_Renderer.cxx | 7 +- src/SVTK/SVTK_Renderer.h | 7 +- src/SVTK/SVTK_View.cxx | 42 +---- src/SVTK/SVTK_ViewWindow.cxx | 5 +- 8 files changed, 170 insertions(+), 198 deletions(-) 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); -- 2.39.2