From 9fcd50053c48be36eaceb6671634ff473f87266c Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 20 Sep 2005 14:42:05 +0000 Subject: [PATCH] Porting on SALOME CVS HEAD --- src/SVTK/SALOME_Actor.cxx | 23 ++++++++++------------- src/SVTK/SVTK_InteractorStyle.cxx | 6 ++---- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index 28163b263..494d9c441 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -744,9 +744,7 @@ SALOME_Actor // myPreHighlightActor->SetVisibility( false ); - bool anIsSelectionModeChanged = (theSelectionEvent->mySelectionMode != mySelectionMode); - if(!anIsSelectionModeChanged && mySelectionMode == ActorSelection) - return false; + bool anIsChanged = (mySelectionMode != theSelectionEvent->mySelectionMode); mySelectionMode = theSelectionEvent->mySelectionMode; @@ -754,10 +752,9 @@ SALOME_Actor float y = theSelectionEvent->myY; float z = 0.0; - - bool anIsChanged = false; if( !theIsHighlight ) { + SetPreSelected( false ); vtkActorCollection* theActors = aRenderer->GetActors(); theActors->InitTraversal(); while( vtkActor *ac = theActors->GetNextActor() ) @@ -765,7 +762,6 @@ SALOME_Actor if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) ) anActor->SetPreSelected( false ); - myIsPreselected = theIsHighlight; anIsChanged = true; }else{ switch(mySelectionMode){ @@ -833,20 +829,21 @@ SALOME_Actor } default: { - myPreHighlightActor->SetVisibility( true ); - if( hasIO() && !theSelector->IsSelected( myIO ) ) { + SetPreSelected( true ); + vtkActorCollection* theActors = aRenderer->GetActors(); theActors->InitTraversal(); - while( vtkActor *ac = theActors->GetNextActor() ) + while( vtkActor *anAct = theActors->GetNextActor() ) { - if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) - if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) ) - anActor->SetPreSelected( true ); + if( anAct != this ) + if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( anAct ) ) + if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) ) + anActor->SetPreSelected( true ); } } - myIsPreselected = theIsHighlight; + anIsChanged = true; } } diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index 761cfd3dd..63866170a 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -1038,7 +1038,8 @@ SVTK_InteractorStyle this->FindPokedRenderer(aSelectionEvent->myX,aSelectionEvent->myY); bool anIsChanged = false; - SALOME_Actor* aLastActor = SALOME_Actor::SafeDownCast(myPicker->GetActor()); + if(SALOME_Actor* aLastActor = SALOME_Actor::SafeDownCast(myPicker->GetActor())) + anIsChanged |= aLastActor->PreHighlight( GetSelector(), this, aSelectionEvent, false ); myPicker->Pick(aSelectionEvent->myX, aSelectionEvent->myY, @@ -1047,9 +1048,6 @@ SVTK_InteractorStyle if(SALOME_Actor* anActor = SALOME_Actor::SafeDownCast(myPicker->GetActor())){ anIsChanged |= anActor->PreHighlight( GetSelector(), this, aSelectionEvent, true ); - if(aLastActor && aLastActor != anActor) { - aLastActor->PreHighlight( GetSelector(), this, aSelectionEvent, false ); - } } if(anIsChanged) -- 2.39.2