From: nds Date: Mon, 28 Dec 2015 06:18:03 +0000 (+0300) Subject: Crash in sketch on external objects use. Scenario: X-Git-Tag: V_2.1.0~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=964bbd40583bca5f84e596d1b7339f2799b40e79;p=modules%2Fshaper.git Crash in sketch on external objects use. Scenario: 1. Create crossed controur in sketch 2. Create extrusion(CompSolid). 3. Create a controur with all points belong to external sketch lines. Problem: 1.found compsolid was used instead of found external object 2. the second selection of external object should be checked by isExternal flag of the feature. --- diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index d34128d16..477da7ae3 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -368,11 +368,14 @@ void PartSet_WidgetPoint2D::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMous std::shared_ptr aSPFeature; if (aSelectedFeature.get() != NULL) aSPFeature = std::dynamic_pointer_cast(aSelectedFeature); - if ((!aSPFeature) && (!aShape.IsNull())) { + if ((!aSPFeature && !aShape.IsNull()) || + (aSPFeature.get() && aSPFeature->isExternal())) { anExternal = true; ResultPtr aFixedObject = PartSet_Tools::findFixedObjectByExternal(aShape, aObject, mySketch); if (!aFixedObject.get()) aObject = PartSet_Tools::createFixedObjectByExternal(aShape, aObject, mySketch); + else + aObject = aFixedObject; double aX, aY; if (getPoint2d(aView, aShape, aX, aY) && isFeatureContainsPoint(myFeature, aX, aY)) {