]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #108: Extrusion for imported shape is provided
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 5 Sep 2014 13:01:26 +0000 (17:01 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 5 Sep 2014 13:01:26 +0000 (17:01 +0400)
src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp

index 7c6a0eaebb82f4763ebcd333163a2e127c346648..1fb6e46d58089ea69e474bbf0f0daa8fff9bcecc 100644 (file)
@@ -33,12 +33,20 @@ void FeaturesPlugin_Extrusion::execute()
       ModelAPI_AttributeReference>(data()->attribute(FeaturesPlugin_Extrusion::FACE_ID()));
   if (!aFaceRef)
     return;
+  boost::shared_ptr<GeomAPI_Shape> aFace;
   boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = boost::dynamic_pointer_cast<
       ModelAPI_ResultConstruction>(aFaceRef->value());
-  if (!aConstr)
-    return;
-  boost::shared_ptr<GeomAPI_Shape> aFace = aConstr->shape();
-  if (!aFace)
+  if (aConstr) {
+    aFace = aConstr->shape();
+  }
+  if (!aFace) {
+    // Check for body
+    boost::shared_ptr<ModelAPI_ResultBody> 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();