From: nds Date: Mon, 16 Jan 2017 15:31:17 +0000 (+0300) Subject: Issue #1787 : code's adjusting X-Git-Tag: V_2.7.0~338 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=904e1f50449d938d2a2494d8f76abfd0c91364f9;p=modules%2Fshaper.git Issue #1787 : code's adjusting --- diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index 3ce8252b1..b9470abc7 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -457,49 +457,50 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo std::shared_ptr aSPFeature; if (aSelectedFeature.get() != NULL) aSPFeature = std::dynamic_pointer_cast(aSelectedFeature); - if ((!aSPFeature && !aShape.IsNull()) || - (aSPFeature.get() && aSPFeature->isExternal())) { - ResultPtr aFixedObject; - anExternal = true; - aFixedObject = PartSet_Tools::findFixedObjectByExternal(aShape, aObject, mySketch); - if (!aFixedObject.get()) - aFixedObject = PartSet_Tools::createFixedObjectByExternal(aShape, aObject, mySketch); - 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 - // if the feature contains the point, focus is not switched + + if ((!aSPFeature && !aShape.IsNull()) || + (aSPFeature.get() && aSPFeature->isExternal())) { + ResultPtr aFixedObject; + anExternal = true; + aFixedObject = PartSet_Tools::findFixedObjectByExternal(aShape, aObject, mySketch); + if (!aFixedObject.get()) + aFixedObject = PartSet_Tools::createFixedObjectByExternal(aShape, aObject, mySketch); + 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 + // if the feature contains the point, focus is not switched + setPoint(aX, aY); + } + else { + if (getPoint2d(aView, aShape, aX, aY)) setPoint(aX, aY); - } - else { - if (getPoint2d(aView, aShape, aX, aY)) - setPoint(aX, aY); - else - setValueState(Stored); // in case of edge selection, Apply state should also be updated - bool anOrphanPoint = aShape.ShapeType() == TopAbs_VERTEX || - isOrphanPoint(aSelectedFeature, mySketch, aX, aY); - if (anExternal) { - // we should not stop reentrant operation on external objects because - anOrphanPoint = true; - // they are not participate in the contour creation excepting external vertices - if (aShape.ShapeType() == TopAbs_VERTEX) { - FeaturePtr aFixedFeature = ModelAPI_Feature::feature(aFixedObject); - if (aFixedFeature.get() && aFixedFeature->getKind() == SketchPlugin_Point::ID()) { - anOrphanPoint = isOrphanPoint(aFixedFeature, mySketch, aX, aY); - } + else + setValueState(Stored); // in case of edge selection, Apply state should also be updated + bool anOrphanPoint = aShape.ShapeType() == TopAbs_VERTEX || + isOrphanPoint(aSelectedFeature, mySketch, aX, aY); + if (anExternal) { + // we should not stop reentrant operation on external objects because + anOrphanPoint = true; + // they are not participate in the contour creation excepting external vertices + if (aShape.ShapeType() == TopAbs_VERTEX) { + FeaturePtr aFixedFeature = ModelAPI_Feature::feature(aFixedObject); + if (aFixedFeature.get() && aFixedFeature->getKind() == SketchPlugin_Point::ID()) { + anOrphanPoint = isOrphanPoint(aFixedFeature, mySketch, aX, aY); } } - if (aFixedObject.get()) - setConstraintWith(aFixedObject); - // fignal updated should be flushed in order to visualize possible created - // external objects e.g. selection of trihedron axis when input end arc point - updateObject(feature()); + } + if (aFixedObject.get()) + setConstraintWith(aFixedObject); + // fignal updated should be flushed in order to visualize possible created + // external objects e.g. selection of trihedron axis when input end arc point + updateObject(feature()); - if (!anOrphanPoint) - emit vertexSelected(); // it stops the reentrant operation + if (!anOrphanPoint) + emit vertexSelected(); // it stops the reentrant operation - emit focusOutWidget(this); - } + emit focusOutWidget(this); } + } if (!anExternal) { double aX, aY; bool isProcessed = false;