Salome HOME
bos #18968 [CEA] Sometimes when clicking to add a face to a group two faces are added
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewModel.cxx
index 7a15bb745e8900a2e06efeba635d48b8981dfbed..eb7ff1564746fbd1d0a4dcbc30827d83f24ee52a 100644 (file)
@@ -21,7 +21,6 @@
 //
 
 #include "OCCViewer_ViewModel.h"
-#include "OCCViewer.h"
 #include "OCCViewer_ViewFrame.h"
 #include "OCCViewer_VService.h"
 #include "OCCViewer_ViewPort3d.h"
@@ -143,10 +142,6 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron)
   myAISContext->HighlightStyle(Prs3d_TypeOfHighlight_LocalSelected)->SetColor( Quantity_NOC_WHITE );
   myAISContext->HighlightStyle(Prs3d_TypeOfHighlight_Selected)->SetColor( Quantity_NOC_WHITE );
 
-  // Set overlap detection for common behaviour of Rect selection and Polygon selection
-  // (both selects an object with partial overlap)
-  myAISContext->MainSelector()->AllowOverlapDetection(true);
-  
   // display isoline on planar faces (box for ex.)
   myAISContext->IsoOnPlane( true );
 
@@ -378,7 +373,6 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t
   myEndPnt.setX(theEvent->x()); myEndPnt.setY(theEvent->y());
   bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
   
-
   if (myStartPnt == myEndPnt)
   {
     if (!aHasShift) {
@@ -396,7 +390,9 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t
       myAISContext->ShiftSelect( Standard_True );
     else 
       myAISContext->Select( Standard_True );
+    emit selectionChanged();
   }
+
   //else
   //{
   //  if (aHasShift && myMultiSelectionEnabled)
@@ -422,7 +418,6 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t
 
   //  myAISContext->UpdateCurrentViewer();
   //}
-  emit selectionChanged();
 }
 
 /*!