]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Dragging selected vertex of a line
authorvsv <vitaly.smetannikov@opencascade.com>
Sat, 27 Dec 2014 08:07:10 +0000 (11:07 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Sat, 27 Dec 2014 08:07:10 +0000 (11:07 +0300)
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_SketcherMgr.cpp

index 5898c252db08c15615fadd2313cbaf7cc2f004c2..c1348168e8dd5be66e7c0312af78dbb61aa8bc44 100644 (file)
@@ -254,17 +254,9 @@ void PartSet_Module::onSelectionChanged()
         }
       }
     }
-  } else if (mySketchMgr->sketchOperationIdList().contains(aOperation->id()) && 
-    aOperation->isEditOperation()) {
-    // if this is sketch operation in edit mode
-
-      ModuleBase_ISelection* aSelect = myWorkshop->selection();
-      //aSelect->selectedShapes();
-  }
+  } 
 }
 
-      // after movement the solver will call the update event: optimization
-
 void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
 {
   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
index a2303017c011a052de5755bd21540c5a0e3e3dae..fd8a22ee036f59b52242c20a5305a6c0317ebc71 100644 (file)
@@ -148,7 +148,7 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE
           aOperation->abort();
       return;
     }
-    if ((aHighlighted.size() == 1) && (aSelected.size() == 0)) {
+    if (aSelObjects.size() == 1) {
       // Move by selected shape (vertex). Can be used only for single selection
       foreach(ModuleBase_ViewerPrs aPrs, aHighlighted) {
         FeaturePtr aFeature = ModelAPI_Feature::feature(aHighlighted.first().object());
@@ -219,17 +219,19 @@ void PartSet_SketcherMgr::onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouse
       aOp->commit();
       myEditingFeatures.clear();
       myEditingAttr.clear();
+
+      // Reselect edited object
+      aViewer->AISContext()->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView());
+      if (theEvent->modifiers() & Qt::ShiftModifier)
+        aViewer->AISContext()->ShiftSelect();
+      else
+        aViewer->AISContext()->Select();
       return;
     }
   }
   if (!aViewer->isMultiSelectionEnabled()) {
     aViewer->enableMultiselection(true);
   }
-  //aViewer->AISContext()->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView());
-  //if (theEvent->modifiers() & Qt::ShiftModifier)
-  //  aViewer->AISContext()->ShiftSelect();
-  //else
-  //  aViewer->AISContext()->Select();
 }
 
 void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)