From: vsv Date: Tue, 16 Oct 2018 15:18:52 +0000 (+0300) Subject: Issue #2702: Accept feature of a plane as a sketcher plane X-Git-Tag: V9_2_0a2~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=da89d1e8b958b5677dbf4025a623e10be062c51c;p=modules%2Fshaper.git Issue #2702: Accept feature of a plane as a sketcher plane --- diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.cpp b/src/ModuleBase/ModuleBase_WidgetValidated.cpp index 308e14770..6fbd9b174 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValidated.cpp @@ -130,6 +130,9 @@ bool ModuleBase_WidgetValidated::isValidInFilters(const ModuleBase_ViewerPrsPtr& std::dynamic_pointer_cast(anAttr); aSelectAttr->setValue(myPresentedObject, GeomShapePtr(), true); GeomShapePtr aShape = aSelectAttr->value(); + if (!aShape.get() && aSelectAttr->contextFeature()->firstResult().get()) { + aShape = aSelectAttr->contextFeature()->firstResult()->shape(); + } if (aShape.get()) { const TopoDS_Shape aTDShape = aShape->impl(); Handle(AIS_InteractiveObject) anIO = myWorkshop->selection()->getIO(thePrs); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 03007a3eb..8714eb98d 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -462,6 +462,18 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_View isOwnerSet = true; } } + else { + aSelAttr->setValue(aFeature, GeomShapePtr()); + GeomShapePtr aShape = aSelAttr->value(); + if (!aShape.get() && aSelAttr->contextFeature()->firstResult().get()) { + aShape = aSelAttr->contextFeature()->firstResult()->shape(); + } + if (aShape.get()) { + const TopoDS_Shape& aTDShape = aShape->impl(); + setSketchPlane(aTDShape); + isOwnerSet = true; + } + } } } return isOwnerSet;