Salome HOME
INTPAL 53231: 'Display tab white spaces' preference does not affect on Python view.
[modules/gui.git] / src / LightApp / LightApp_VTKSelector.cxx
index 005b6b644d7bc6e4e0884a96d074bb7b2bb7cde7..4bcbead86f2dbeda336e6070f08d78265a449a43 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
   #include "SVTK_Functor.h"
   #include "VTKViewer_Algorithm.h"
   #include <vtkRenderer.h>
+  #include "SVTK_ViewModel.h"
 #endif
 
 #ifndef DISABLE_SALOMEOBJECT
   #include "SALOME_Actor.h"
-  #include "SALOME_ListIteratorOfListIO.hxx"
+  #include "SALOME_ListIO.hxx"
 #endif
 
 
@@ -186,7 +187,11 @@ void
 LightApp_VTKSelector
 ::getSelection( SUIT_DataOwnerPtrList& aList ) const
 {
-  if(myViewer){
+  if( myViewer ) {
+    if( SVTK_Viewer* aSViewer = dynamic_cast<SVTK_Viewer*>(myViewer) ) {
+      if( !aSViewer->isSelectionEnabled() ) 
+       return;
+    }
     if(SUIT_ViewManager* aViewManager = myViewer->getViewManager()){
       if(SVTK_ViewManager* aViewMgr = dynamic_cast<SVTK_ViewManager*>(aViewManager)){
         if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewMgr->getActiveView())){
@@ -212,7 +217,8 @@ void
 LightApp_VTKSelector
 ::setSelection( const SUIT_DataOwnerPtrList& theList )
 {
-  if(myViewer){
+  SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myViewer);
+  if(myViewer && aViewer && aViewer->isSelectionEnabled()){
     if(SUIT_ViewManager* aViewMgr = myViewer->getViewManager()){
       if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewMgr->getActiveView())){
         if(SVTK_Selector* aSelector = aView->GetSelector()){