From: apo Date: Mon, 10 Dec 2007 14:34:18 +0000 (+0000) Subject: Fix for Bug NPAL18219 X-Git-Tag: V3_2_9~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0dcc27ca30a2a50ca6b76ce58fc3af7f0d024cdf;p=modules%2Fgui.git Fix for Bug NPAL18219 EDF 618 VISU : Regression, Lost of permformance in Vectors representation --- diff --git a/src/SVTK/SVTK_Selector.cxx b/src/SVTK/SVTK_Selector.cxx index ead47cbbc..c23a922cb 100644 --- a/src/SVTK/SVTK_Selector.cxx +++ b/src/SVTK/SVTK_Selector.cxx @@ -31,6 +31,9 @@ #include "SALOME_Actor.h" +#include "SUIT_Session.h" +#include "SUIT_ResourceMgr.h" + #include #include @@ -548,15 +551,24 @@ SALOME_Actor* SVTK_SelectorDef ::Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const { - myCellPicker->Pick(theEvent->myX, - theEvent->myY, - 0.0, - theRenderer); - - vtkActorCollection* aListActors = myCellPicker->GetActors(); - SALOME_Actor* anActor = GetLastSALOMEActor(aListActors); + bool anAdvancedSelectionAlgorithm = true; + SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); + if ( aResourceMgr ) + anAdvancedSelectionAlgorithm = aResourceMgr->booleanValue( "VTKViewer", "selection_algorithm", true ); + + SALOME_Actor* anActor = NULL; + vtkActorCollection* aListActors = NULL; + if ( anAdvancedSelectionAlgorithm ) { + myCellPicker->Pick(theEvent->myX, + theEvent->myY, + 0.0, + theRenderer); - if (! anActor) { + aListActors = myCellPicker->GetActors(); + anActor = GetLastSALOMEActor(aListActors); + } + + if ( !anActor ) { myPicker->Pick(theEvent->myX, theEvent->myY, 0.0,