]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting on SALOME CVS HEAD
authorapo <apo@opencascade.com>
Tue, 20 Sep 2005 14:42:05 +0000 (14:42 +0000)
committerapo <apo@opencascade.com>
Tue, 20 Sep 2005 14:42:05 +0000 (14:42 +0000)
src/SVTK/SALOME_Actor.cxx
src/SVTK/SVTK_InteractorStyle.cxx

index 28163b263fa47cce44689656a717669d8088aaba..494d9c44167a8971c89df2c80b91c15a83c62879 100644 (file)
@@ -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;
     }
     }
index 761cfd3dd034c4dd02d3abd88b603f12942d12e5..63866170adbd9398782ab4627d8c7e121e57583e 100644 (file)
@@ -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)