From 9bbbe88cc0ba2e6bc814fedf5cd0c5dd05a9dacc Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 6 Apr 2016 13:47:06 +0300 Subject: [PATCH] Issue #1343. Improvement of Extrusion and Revolution operations: compilation correction --- src/PartSet/PartSet_WidgetSketchLabel.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 50d0308ec..8a45411db 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -359,17 +359,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.IsNull()) { - if (aResult.get()) { - GeomShapePtr aGeomShape = aResult->shape(); - std::shared_ptr aGeomFace(new GeomAPI_Face(aGeomShape)); - aCanFillSketch = aGeomFace.get() && aGeomFace->isPlanar(); - } + + GeomShapePtr aGeomShape = thePrs.shape(); + if ((!aGeomShape.get() || aGeomShape->isNull()) && aResult.get()) { + aGeomShape = aResult->shape(); } - else if (aShape.ShapeType() == TopAbs_FACE) { - std::shared_ptr aGeomFace(new GeomAPI_Face()); - aGeomFace->setImpl(new TopoDS_Shape(aShape)); + + if (aGeomShape.get() && aGeomShape->shapeType() == GeomAPI_Shape::FACE) { + std::shared_ptr aGeomFace(new GeomAPI_Face(aGeomShape)); aCanFillSketch = aGeomFace.get() && aGeomFace->isPlanar(); } else @@ -410,7 +407,7 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const FeaturePtr& the } else if (aShape.get() && !aShape->isNull()) { const TopoDS_Shape& aTDShape = aShape->impl(); - aDir = setSketchPlane(aTDShape); + aDir = setSketchPlane(theFeature, aTDShape); isOwnerSet = aDir.get(); } return isOwnerSet; -- 2.39.2