From 45b81a6a0235d944f6324f5eaa591e4740af6eff Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 29 Oct 2014 17:19:38 +0300 Subject: [PATCH] Issue #190: Extrusion has to use only results with shape --- src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index d7518ef60..bd5e54e70 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -188,9 +189,16 @@ void ModuleBase_WidgetShapeSelector::onSelectionChanged() return; if (mySelectedObject && aObject && mySelectedObject->isSame(aObject)) return; + // Check that the selected object is result (others can not be accepted) + ResultPtr aRes = boost::dynamic_pointer_cast(aObject); + if (!aRes) + return; + // Check that the result has a shape + GeomShapePtr aShape = ModelAPI_Tools::shape(aRes); + if (!aShape) + return; // Get sub-shapes from local selection - boost::shared_ptr aShape; if (myUseSubShapes) { NCollection_List aShapeList; std::list aOwners; -- 2.39.2