Salome HOME
Issue #1343 Improvement of Extrusion and Revolution operations: plane selection in OB.
authornds <nds@opencascade.com>
Tue, 22 Mar 2016 12:03:43 +0000 (15:03 +0300)
committerdbv <dbv@opencascade.com>
Wed, 6 Apr 2016 10:22:05 +0000 (13:22 +0300)
src/PartSet/PartSet_WidgetSketchLabel.cpp

index cc56f1abd88dd668a1cd44e1bb51a5198fff065d..d5040dc78d0da6f6041cd2b0ec21370f1bf5b179 100644 (file)
@@ -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<GeomAPI_Face> aGeomFace;
     const TopoDS_Shape aShape = thePrs.shape();
-    if (aShape.ShapeType() == TopAbs_FACE) {
+    if (aShape.IsNull()) {
+      GeomShapePtr aGeomShape = aResult->shape();
+      std::shared_ptr<GeomAPI_Face> aGeomFace(new GeomAPI_Face(aGeomShape));
+      aCanFillSketch = aGeomFace.get() && aGeomFace->isPlanar();
+    }
+    else if (aShape.ShapeType() == TopAbs_FACE) {
       std::shared_ptr<GeomAPI_Face> aGeomFace(new GeomAPI_Face());
       aGeomFace->setImpl(new TopoDS_Shape(aShape));
       aCanFillSketch = aGeomFace.get() && aGeomFace->isPlanar();