]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for sketch in ExtrusionCut operation
authorvsv <vsv@opencascade.com>
Thu, 20 Sep 2018 12:57:21 +0000 (15:57 +0300)
committervsv <vsv@opencascade.com>
Thu, 20 Sep 2018 12:57:21 +0000 (15:57 +0300)
src/PartSet/PartSet_WidgetSketchLabel.cpp

index 8e83afc0dd60407fb0f5e4554819070129d9da21..03007a3eb24a6cdede1c5d9d60baa8db2490bb91 100644 (file)
@@ -448,7 +448,13 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_View
     if (aSelAttr.get()) {
       ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(thePrs->object());
       if (aRes.get()) {
-        GeomShapePtr aShapePtr = ModelAPI_Tools::shape(aRes);
+        GeomShapePtr aShapePtr;
+        if (!aShape.get() || aShape->isNull()) {  // selection happens in the OCC viewer
+          aShapePtr = ModelAPI_Tools::shape(aRes);
+        }
+        else { // selection happens in OB browser
+          aShapePtr = aShape;
+        }
         if (aShapePtr.get() && aShapePtr->isFace()) {
           const TopoDS_Shape& aTDShape = aShapePtr->impl<TopoDS_Shape>();
           setSketchPlane(aTDShape);