From 74d52e8ca4a057497f87a98ee90a7e40bfcf54d1 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 22 Mar 2016 15:03:43 +0300 Subject: [PATCH] Issue #1343 Improvement of Extrusion and Revolution operations: plane selection in OB. --- src/PartSet/PartSet_WidgetSketchLabel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index cc56f1abd..d5040dc78 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -334,8 +334,14 @@ bool PartSet_WidgetSketchLabel::canFillSketch(const ModuleBase_ViewerPrs& thePrs } // check plane or planar face of any non-sketch object if (aCanFillSketch) { + std::shared_ptr aGeomFace; const TopoDS_Shape aShape = thePrs.shape(); - if (aShape.ShapeType() == TopAbs_FACE) { + if (aShape.IsNull()) { + GeomShapePtr aGeomShape = aResult->shape(); + std::shared_ptr aGeomFace(new GeomAPI_Face(aGeomShape)); + aCanFillSketch = aGeomFace.get() && aGeomFace->isPlanar(); + } + else if (aShape.ShapeType() == TopAbs_FACE) { std::shared_ptr aGeomFace(new GeomAPI_Face()); aGeomFace->setImpl(new TopoDS_Shape(aShape)); aCanFillSketch = aGeomFace.get() && aGeomFace->isPlanar(); -- 2.39.2