]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1787 : modification condition to do not create new external object by local...
authornds <nds@opencascade.com>
Tue, 17 Jan 2017 05:05:39 +0000 (08:05 +0300)
committernds <nds@opencascade.com>
Tue, 17 Jan 2017 05:05:39 +0000 (08:05 +0300)
src/PartSet/PartSet_WidgetPoint2d.cpp

index b9470abc7ce1bcc2bc45ad2b47034bdcf390a849..e6c1cf1d314f8b2a102283cf3464a7366319db7f 100644 (file)
@@ -458,13 +458,20 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo
     if (aSelectedFeature.get() != NULL)
       aSPFeature = std::dynamic_pointer_cast<SketchPlugin_Feature>(aSelectedFeature);
 
-    if ((!aSPFeature && !aShape.IsNull()) ||
-        (aSPFeature.get() && aSPFeature->isExternal())) {
-      ResultPtr aFixedObject;
-      anExternal = true;
+    ResultPtr aFixedObject;
+    bool aSketchExternalFeature = aSPFeature.get() && aSPFeature->isExternal();
+    if ((!aSPFeature && !aShape.IsNull()) || aSketchExternalFeature) {
       aFixedObject = PartSet_Tools::findFixedObjectByExternal(aShape, aObject, mySketch);
-      if (!aFixedObject.get())
-        aFixedObject = PartSet_Tools::createFixedObjectByExternal(aShape, aObject, mySketch);
+      if (aSketchExternalFeature && !aFixedObject.get()) {/// local selection on external feature
+        anExternal = false;
+      }
+      else {
+        anExternal = true;
+        if (!aFixedObject.get())
+          aFixedObject = PartSet_Tools::createFixedObjectByExternal(aShape, aObject, mySketch);
+      }
+    }
+    if (anExternal) {
       double aX, aY;
       if (getPoint2d(aView, aShape, aX, aY) && isFeatureContainsPoint(myFeature, aX, aY)) {
         // do not create a constraint to the point, which already used by the feature