]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Crash in sketch on external objects use. Scenario:
authornds <nds@opencascade.com>
Mon, 28 Dec 2015 06:18:03 +0000 (09:18 +0300)
committernds <nds@opencascade.com>
Mon, 28 Dec 2015 06:18:03 +0000 (09:18 +0300)
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.

src/PartSet/PartSet_WidgetPoint2d.cpp

index d34128d1643ab53de997642e8847f87117f56109..477da7ae311970c93f373ce4b73df3fa5e2bde7d 100644 (file)
@@ -368,11 +368,14 @@ void PartSet_WidgetPoint2D::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMous
       std::shared_ptr<SketchPlugin_Feature> aSPFeature;
       if (aSelectedFeature.get() != NULL)
         aSPFeature = std::dynamic_pointer_cast<SketchPlugin_Feature>(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)) {