From: nds Date: Tue, 17 Jan 2017 05:05:39 +0000 (+0300) Subject: Issue #1787 : modification condition to do not create new external object by local... X-Git-Tag: V_2.7.0~337 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c5bad0c8b1773a977106d471797ffc4f067249c5;p=modules%2Fshaper.git Issue #1787 : modification condition to do not create new external object by local selection --- diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index b9470abc7..e6c1cf1d3 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -458,13 +458,20 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo if (aSelectedFeature.get() != NULL) aSPFeature = std::dynamic_pointer_cast(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