]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
To improve rectangle selection
authorapo <apo@opencascade.com>
Wed, 17 Aug 2005 10:49:19 +0000 (10:49 +0000)
committerapo <apo@opencascade.com>
Wed, 17 Aug 2005 10:49:19 +0000 (10:49 +0000)
src/SVTK/SVTK_InteractorStyle.cxx

index a46435af15947d61c5b85000eed17b0f315cf0b2..25e0216a12e249fb56466627feb70171a9e8b6d2 100644 (file)
@@ -1002,8 +1002,6 @@ SVTK_InteractorStyle
            this->HighlightProp( NULL );
            GetSelector()->ClearIObjects();
          }
-
-         Interactor->EndPickCallback();
         } else {
           //processing rectangle selection
          if(aSelActiveCompOnly && aComponentDataType.isEmpty()) return;
@@ -1033,52 +1031,19 @@ SVTK_InteractorStyle
          aSelectionEvent.LastX = x1;
          aSelectionEvent.LastY = y1;
          
-         switch (aSelectionMode) {
-         case NodeSelection: {
-           //if ( vtkPointPicker* aPointPicker = vtkPointPicker::SafeDownCast(Interactor->GetPicker()) ) {
-             vtkActorCollection* aListActors = this->CurrentRenderer->GetActors();
-             aListActors->InitTraversal();
-             while (vtkActor* aActor = aListActors->GetNextActor()) {
-               if (!aActor->GetVisibility()) 
-                 continue;
-               if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor))
-                 aSActor->Highlight( this, GetSelector(), this->CurrentRenderer, aSelectionEvent, true );
-             }
-             //}
-           break;
-         }
-         case CellSelection:
-         case EdgeOfCellSelection:
-         case EdgeSelection:
-         case FaceSelection:
-         case VolumeSelection: 
-           {
-             vtkSmartPointer<VTKViewer_CellRectPicker> picker = VTKViewer_CellRectPicker::New();
-             picker->SetTolerance(0.001);
-             picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
-             
-             vtkActorCollection* aListActors = picker->GetActors();
-             aListActors->InitTraversal();
-             while(vtkActor* aActor = aListActors->GetNextActor())
-               if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor))
-                 aSActor->Highlight( this, GetSelector(), this->CurrentRenderer, aSelectionEvent, true );
+         vtkSmartPointer<VTKViewer_RectPicker> aPicker = VTKViewer_RectPicker::New();
+         aPicker->SetTolerance(0.001);
+         aPicker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
+
+         vtkActorCollection* aListActors = aPicker->GetActors();
+         aListActors->InitTraversal();
+         while(vtkActor* aActor = aListActors->GetNextActor()){
+           if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)){
+             aSActor->Highlight( this, GetSelector(), this->CurrentRenderer, aSelectionEvent, true );
            }
-           break;          
-         case ActorSelection: // objects selection
-           {
-             vtkSmartPointer<VTKViewer_RectPicker> picker = VTKViewer_RectPicker::New();
-             picker->SetTolerance(0.001);
-             picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
-
-             vtkActorCollection* aListActors = picker->GetActors();
-             aListActors->InitTraversal();
-             while(vtkActor* aActor = aListActors->GetNextActor())
-               if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor))
-                 aSActor->Highlight( this, GetSelector(), this->CurrentRenderer, aSelectionEvent, true );
-           } // end case 4
-         } //end switch
-         Interactor->EndPickCallback();
+         }
        }
+       Interactor->EndPickCallback();
        myViewWindow->onSelectionChanged();
       } 
     }