From: nds Date: Tue, 22 Mar 2016 12:03:43 +0000 (+0300) Subject: Issue #1343 Improvement of Extrusion and Revolution operations: plane selection in OB. X-Git-Tag: V_2.3.0~332 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=74d52e8ca4a057497f87a98ee90a7e40bfcf54d1;p=modules%2Fshaper.git Issue #1343 Improvement of Extrusion and Revolution operations: plane selection in OB. --- 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();