]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for the "0022466: [CEA 1047] Mesh stays selected when selection is
authorrnv <rnv@opencascade.com>
Thu, 27 Feb 2014 06:59:19 +0000 (10:59 +0400)
committerrnv <rnv@opencascade.com>
Thu, 27 Feb 2014 06:59:19 +0000 (10:59 +0400)
disabled in the 3D view" issue.

src/LightApp/LightApp_OCCSelector.cxx
src/LightApp/LightApp_VTKSelector.cxx
src/OCCViewer/OCCViewer_ViewModel.cxx
src/SVTK/SVTK_ViewModel.cxx

index 3e8b4eb181c45a9101f98d2337ab5530a9210827..6f78bc76a91d1ab2d6ac4c698718a388220468da 100644 (file)
@@ -85,6 +85,9 @@ void LightApp_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
   if ( !myViewer )
     return;
 
+  if ( !myViewer->isSelectionEnabled() )
+    return;
+
   AIS_ListOfInteractive aSelList;
   myViewer->getSelectedObjects( aSelList );
   for ( AIS_ListIteratorOfListOfInteractive anIt( aSelList ); anIt.More(); anIt.Next() )
index 015530eb920c1eec52375da231bd41fab5fefad5..79f9e735ae300d52451a26a03bf7fb9949153623 100644 (file)
@@ -187,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())){
index c9e7f933ad875270802ac6471d91f80e0c188dbe..242756b9f26c13f950f233a847d82d66d620de22 100755 (executable)
@@ -533,6 +533,13 @@ void OCCViewer_Viewer::enableSelection(bool isEnabled)
       win->enableSelection( isEnabled );
     }
   }
+
+  
+  //clear current selection in the viewer
+  if(!isEnabled) {
+    myAISContext->ClearSelected( Standard_True );
+  }
+
 }
 
 /*!
@@ -1015,6 +1022,11 @@ void OCCViewer_Viewer::setSelectionOptions( bool isPreselectionEnabled, bool isS
 {
   myPreselectionEnabled = isPreselectionEnabled;
   mySelectionEnabled = isSelectionEnabled;
+  //clear current selection in the viewer
+  
+  if(!mySelectionEnabled) {
+    myAISContext->ClearSelected( Standard_True );
+  }
 }
 
 
index 1e00b2cfc652691a1778ce0b650de461d7c92992..2f2477e9965f81284ada715bf90b25ec6fb64d07 100644 (file)
@@ -504,6 +504,23 @@ void SVTK_Viewer::enableSelection(bool isEnabled)
         aView->SetSelectionEnabled( isEnabled );
     }
   }
+
+  if(!isEnabled) {
+    //clear current selection in the viewer
+    bool blocked = blockSignals( true );
+    if ( SUIT_ViewManager* aViewMgr = getViewManager() ) {
+      if( SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>( aViewMgr->getActiveView() ) ){
+       if( SVTK_Selector* aSelector = aViewWindow->GetSelector() ) {
+         if(SVTK_View* aView = aViewWindow->getView()){
+           aSelector->ClearIObjects();
+           aView->onSelectionChanged();
+         }
+       }
+      }
+    }
+    blockSignals( blocked );  
+  }
+
 }
 
 /*!