]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #178: Impossible to select two sketcher objects under SALOME is fixed
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 20 Oct 2014 13:30:47 +0000 (17:30 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 20 Oct 2014 13:30:47 +0000 (17:30 +0400)
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_OperationFeatureEdit.cpp
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Viewer.cpp

index a44256ea79eac1c1f3629a90499eefde3b2c2fca..ff1e43a7ddf0894825195634ba4e2e48a03b8e72 100644 (file)
@@ -197,7 +197,7 @@ void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
         aDisplayer->activate(aFeature, aModes);
       }
     }
-  } else {
+  }// else {
     // Activate results of current feature for selection
     //FeaturePtr aFeature = theOperation->feature();
     //XGUI_Displayer* aDisplayer = aXWshp->displayer();
@@ -205,13 +205,8 @@ void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
     //std::list<ResultPtr>::const_iterator aIt;
     //for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
     //  aDisplayer->activate(*aIt);
-    //}
-
-    
-    
-  }
-  // Clear selection done during operation
-  aDisplayer->clearSelected();
+    //}    
+  //}
 }
 
 void PartSet_Module::onContextMenuCommand(const QString& theId, bool isChecked)
index 1e0932280931eaf2fd2e1ee83163e555cf1ac6c3..4ad8a63cd60183ecbdebade62cbc65b5caa33178 100644 (file)
@@ -73,20 +73,21 @@ void PartSet_OperationFeatureEdit::mousePressed(QMouseEvent* theEvent, Handle(V3
     if (commit()) {
       emit featureConstructed(feature(), FM_Deactivation);
 
-      bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
-      if (aHasShift && !theHighlighted.empty()) {
-        QList<ObjectPtr> aSelected;
-        std::list<ModuleBase_ViewerPrs>::const_iterator aIt;
-        for (aIt = theSelected.cbegin(); aIt != theSelected.cend(); ++aIt)
-          aSelected.append((*aIt).object());
+      //bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
+      //if (aHasShift && !theHighlighted.empty()) {
+      //  QList<ObjectPtr> aSelected;
+      //  std::list<ModuleBase_ViewerPrs>::const_iterator aIt;
+      //  for (aIt = theSelected.cbegin(); aIt != theSelected.cend(); ++aIt)
+      //    aSelected.append((*aIt).object());
         /*for (aIt = theHighlighted.cbegin(); aIt != theHighlighted.cend(); ++aIt) {
          if (!aSelected.contains((*aIt).object()))
          aSelected.append((*aIt).object());
          }*/
         //aSelected.push_back(feature());
         //aSelected.push_back(theHighlighted.front().object());
-        emit setSelection(aSelected);
-      } else if (aFeature) {
+        //emit setSelection(aSelected);
+      //} else 
+      if (aFeature) {
         restartOperation(PartSet_OperationFeatureEdit::Type(), aFeature);
       }
     }
index dbe635b33d2d5b25be75b94c51ec7731606fed9d..8e0f38400d48cf1f6ece06010e3138a16ad6b881 100644 (file)
@@ -258,8 +258,10 @@ void XGUI_Displayer::setSelected(const QList<ObjectPtr>& theResults, const bool
 void XGUI_Displayer::clearSelected()
 {
   Handle(AIS_InteractiveContext) aContext = AISContext();
-  if (aContext)
+  if (aContext) {
+    aContext->UnhilightCurrents(false);
     aContext->ClearSelected();
+  }
 }
 
 void XGUI_Displayer::eraseAll(const bool isUpdateViewer)
index a2864475b963179cd6ee7bed4b6ed4d94d89dbe6..3a81496155da40783e179953e8384d92d2cc0349 100644 (file)
@@ -551,10 +551,10 @@ void XGUI_Viewer::onMouseReleased(XGUI_ViewWindow* theWindow, QMouseEvent* theEv
 
   if (myStartPnt == myEndPnt) {
     // the MoveTo is necessary for the second click in the same point. Otherwise the selection is lost.
-    Handle(V3d_View) aView3d = theWindow->viewPort()->getView();
-    if (!aView3d.IsNull()) {
-      myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d);
-    }
+    //Handle(V3d_View) aView3d = theWindow->viewPort()->getView();
+    //if (!aView3d.IsNull()) {
+    //  myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d);
+    //}
     if (aHasShift && myMultiSelectionEnabled)
       myAISContext->ShiftSelect();
     else