From: vsv Date: Mon, 29 Oct 2018 13:58:50 +0000 (+0300) Subject: Issue #2728: Accept result part as possible base of sketch X-Git-Tag: End2018~238 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=706ed2941f55af30eecfd8a329a5feae6967829b;p=modules%2Fshaper.git Issue #2728: Accept result part as possible base of sketch --- diff --git a/src/PartSet/PartSet_PreviewPlanes.cpp b/src/PartSet/PartSet_PreviewPlanes.cpp index 7585f21be..961c35ccb 100755 --- a/src/PartSet/PartSet_PreviewPlanes.cpp +++ b/src/PartSet/PartSet_PreviewPlanes.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -49,7 +50,9 @@ bool PartSet_PreviewPlanes::hasVisualizedBodies(ModuleBase_IWorkshop* theWorksho foreach (ObjectPtr anObj, aDisplayed) { ResultPtr aResult = std::dynamic_pointer_cast(anObj); // result constructions should not be taken as a body - if (aResult.get() != NULL && aResult->groupName() == ModelAPI_ResultBody::group()) { + if (aResult.get() != NULL && + ((aResult->groupName() == ModelAPI_ResultBody::group()) || + ((aResult->groupName() == ModelAPI_ResultPart::group()))) ) { GeomShapePtr aShape = aResult->shape(); if (aShape.get()) { // vertices, edges should not be taken as a body diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 8714eb98d..14c7fbe57 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -465,10 +465,11 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_View else { aSelAttr->setValue(aFeature, GeomShapePtr()); GeomShapePtr aShape = aSelAttr->value(); - if (!aShape.get() && aSelAttr->contextFeature()->firstResult().get()) { + if (!aShape.get() && aSelAttr->contextFeature().get() && + aSelAttr->contextFeature()->firstResult().get()) { aShape = aSelAttr->contextFeature()->firstResult()->shape(); } - if (aShape.get()) { + if (aShape.get() && aShape->isPlanar()) { const TopoDS_Shape& aTDShape = aShape->impl(); setSketchPlane(aTDShape); isOwnerSet = true;