]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_OperationSketch.cpp
Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / PartSet / PartSet_OperationSketch.cpp
index cd2e3920d1d39e919a8d215ed2531d97f90b5750..e57a113b73ebc39cc1a6cd82a708afc48c8c795d 100644 (file)
@@ -57,19 +57,11 @@ boost::shared_ptr<ModelAPI_Feature> PartSet_OperationSketch::sketch() const
 }
 
 void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView,
-                                           const std::list<XGUI_ViewerPrs>& theSelected)
+                                           const std::list<XGUI_ViewerPrs>& /*theSelected*/,
+                                           const std::list<XGUI_ViewerPrs>& theHighlighted)
 {
-  myFeatures = theSelected;
-}
-
-void PartSet_OperationSketch::mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
-                                            const std::list<XGUI_ViewerPrs>& theSelected)
-{
-  if (theSelected.empty())
-    return;
-
   if (!myIsEditMode) {
-    XGUI_ViewerPrs aPrs = theSelected.front();
+    XGUI_ViewerPrs aPrs = theHighlighted.front();
     const TopoDS_Shape& aShape = aPrs.shape();
     if (!aShape.IsNull()) {
       setSketchPlane(aShape);
@@ -77,13 +69,14 @@ void PartSet_OperationSketch::mouseReleased(QMouseEvent* theEvent, Handle_V3d_Vi
     }
   }
   else {
-    if (theSelected.size() == 1) {
-      boost::shared_ptr<ModelAPI_Feature> aFeature = theSelected.front().feature();
+    if (theHighlighted.size() == 1) {
+      boost::shared_ptr<ModelAPI_Feature> aFeature = theHighlighted.front().feature();
       if (aFeature)
         emit launchOperation(PartSet_OperationEditLine::Type(), aFeature);
     }
+    else
+      myFeatures = theHighlighted;
   }
-  myFeatures.clear();
 }
 
 void PartSet_OperationSketch::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView)