From: apo Date: Wed, 17 Aug 2005 10:49:19 +0000 (+0000) Subject: To improve rectangle selection X-Git-Tag: BR-D5-38-2003_D2005-12-09~46 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=209357b22c486d894384bff00e7ff7a024b80d4c;p=modules%2Fgui.git To improve rectangle selection --- diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index a46435af1..25e0216a1 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -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 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 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 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(); } }