From dfdf2bfba7304a7c121ae5911653a80b98f6a48d Mon Sep 17 00:00:00 2001 From: dmv Date: Mon, 19 May 2008 07:58:39 +0000 Subject: [PATCH] NPAL18219 EDF 618 VISU : Regression, Lost of permformance in Vectors representation --- src/SVTK/SVTK_Selector.cxx | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/SVTK/SVTK_Selector.cxx b/src/SVTK/SVTK_Selector.cxx index fe5a93047..d9fd3181c 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 @@ -545,15 +548,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", "use_advanced_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, -- 2.39.2