X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetShapeSelector.cpp;h=bd5e54e707b51b445aeeaad5f50eb4cac305047b;hb=dcd54507eb794c21a02c95ad26c1779c36481274;hp=1de73631a75a822059f694ee04595d6f7d59c3e3;hpb=a5a4efb5a57703a634a60c097b6ab9179a04e6d4;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index 1de73631a..bd5e54e70 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -46,8 +47,7 @@ #include #include -#include -#include +#include typedef QMap ShapeTypes; static ShapeTypes MyShapeTypes; @@ -189,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;