]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
NPAL18219 EDF 618 VISU : Regression, Lost of permformance in Vectors representation
authordmv <dmv@opencascade.com>
Mon, 19 May 2008 07:58:39 +0000 (07:58 +0000)
committerdmv <dmv@opencascade.com>
Mon, 19 May 2008 07:58:39 +0000 (07:58 +0000)
src/SVTK/SVTK_Selector.cxx

index fe5a930470c1bbf2c9585722dacbe98c23e1624a..d9fd3181cc687c0fa931f461e6d82f05599483a0 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>
 
@@ -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,