]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for Bug NPAL18219
authorapo <apo@opencascade.com>
Mon, 10 Dec 2007 14:34:18 +0000 (14:34 +0000)
committerapo <apo@opencascade.com>
Mon, 10 Dec 2007 14:34:18 +0000 (14:34 +0000)
   EDF 618 VISU : Regression, Lost of permformance in Vectors representation

src/SVTK/SVTK_Selector.cxx

index ead47cbbcaacdd7246b4afe743e169fddd4d1875..c23a922cbf3382c52768d87b11cec68554cedb06 100644 (file)
@@ -31,6 +31,9 @@
 
 #include "SALOME_Actor.h"
 
+#include "SUIT_Session.h"
+#include "SUIT_ResourceMgr.h"
+
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
 
@@ -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,