From 53d3f426b973fccee1dc5e5ea6b041c9981458a2 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 5 Sep 2014 17:01:26 +0400 Subject: [PATCH] Issue #108: Extrusion for imported shape is provided --- src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index 7c6a0eaeb..1fb6e46d5 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -33,12 +33,20 @@ void FeaturesPlugin_Extrusion::execute() ModelAPI_AttributeReference>(data()->attribute(FeaturesPlugin_Extrusion::FACE_ID())); if (!aFaceRef) return; + boost::shared_ptr aFace; boost::shared_ptr aConstr = boost::dynamic_pointer_cast< ModelAPI_ResultConstruction>(aFaceRef->value()); - if (!aConstr) - return; - boost::shared_ptr aFace = aConstr->shape(); - if (!aFace) + if (aConstr) { + aFace = aConstr->shape(); + } + if (!aFace) { + // Check for body + boost::shared_ptr aBody = boost::dynamic_pointer_cast< + ModelAPI_ResultBody>(aFaceRef->value()); + if (aBody) + aFace = aBody->shape(); + } + if (!aFace) return; double aSize = data()->real(FeaturesPlugin_Extrusion::SIZE_ID())->value(); -- 2.39.2