From: mpv Date: Thu, 29 Nov 2018 10:51:21 +0000 (+0300) Subject: Make sketch drawer work with construction planes correctly X-Git-Tag: End2018~135 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=01abde5f9c595b7ce15c439c03047477b94a51d1;p=modules%2Fshaper.git Make sketch drawer work with construction planes correctly --- diff --git a/src/SketchPlugin/SketchPlugin_SketchDrawer.cpp b/src/SketchPlugin/SketchPlugin_SketchDrawer.cpp index cc3b90f90..b69c51305 100644 --- a/src/SketchPlugin/SketchPlugin_SketchDrawer.cpp +++ b/src/SketchPlugin/SketchPlugin_SketchDrawer.cpp @@ -79,6 +79,8 @@ void SketchPlugin_SketchDrawer::execute() ObjectPtr aPlaneContext = selection(PLANE_ID())->contextObject(); GeomShapePtr aPlaneShape = selection(PLANE_ID())->value(); + if (!aPlaneShape.get() && aPlaneContext.get()) + aPlaneShape = selection(PLANE_ID())->context()->shape(); if (!aPlaneShape.get() || aPlaneShape->shapeType() != GeomAPI_Shape::FACE) { setError("Error: a sketch plane can not be obtained"); return; // invalid case @@ -93,11 +95,9 @@ void SketchPlugin_SketchDrawer::execute() // by selection of plane aSketch->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())-> setValue(selection(PLANE_ID())->context(), aPlaneShape); - // if reference to non-construction, remove reference, but keep the sketch position - if (aPlaneContext->groupName() != ModelAPI_ResultConstruction::group()) { - aSketch->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())-> - setValue(ResultPtr(), GeomShapePtr()); - } + // remove reference, but keep the sketch position + aSketch->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())-> + setValue(ResultPtr(), GeomShapePtr()); // iterate all edges of the base to find all edges that belong to this plane GeomAPI_DataMapOfShapeShape alreadyProcessed;