]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2702: Accept feature of a plane as a sketcher plane
authorvsv <vsv@opencascade.com>
Tue, 16 Oct 2018 15:18:52 +0000 (18:18 +0300)
committervsv <vsv@opencascade.com>
Tue, 16 Oct 2018 15:18:52 +0000 (18:18 +0300)
src/ModuleBase/ModuleBase_WidgetValidated.cpp
src/PartSet/PartSet_WidgetSketchLabel.cpp

index 308e14770edb8d0017fd96ef3200c0d52554cb87..6fbd9b1749203f2bb5d23bf7a158f41070e96898 100644 (file)
@@ -130,6 +130,9 @@ bool ModuleBase_WidgetValidated::isValidInFilters(const ModuleBase_ViewerPrsPtr&
             std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(anAttr);
           aSelectAttr->setValue(myPresentedObject, GeomShapePtr(), true);
           GeomShapePtr aShape = aSelectAttr->value();
+          if (!aShape.get() && aSelectAttr->contextFeature()->firstResult().get()) {
+            aShape = aSelectAttr->contextFeature()->firstResult()->shape();
+          }
           if (aShape.get()) {
             const TopoDS_Shape aTDShape = aShape->impl<TopoDS_Shape>();
             Handle(AIS_InteractiveObject) anIO = myWorkshop->selection()->getIO(thePrs);
index 03007a3eb24a6cdede1c5d9d60baa8db2490bb91..8714eb98d5d4fe387583b7772b3079bc3acd9585 100644 (file)
@@ -462,6 +462,18 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_View
           isOwnerSet = true;
         }
       }
+      else {
+        aSelAttr->setValue(aFeature, GeomShapePtr());
+        GeomShapePtr aShape = aSelAttr->value();
+        if (!aShape.get() && aSelAttr->contextFeature()->firstResult().get()) {
+          aShape = aSelAttr->contextFeature()->firstResult()->shape();
+        }
+        if (aShape.get()) {
+          const TopoDS_Shape& aTDShape = aShape->impl<TopoDS_Shape>();
+          setSketchPlane(aTDShape);
+          isOwnerSet = true;
+        }
+      }
     }
   }
   return isOwnerSet;