]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the issue #1432
authormpv <mpv@opencascade.com>
Fri, 29 Apr 2016 14:56:37 +0000 (17:56 +0300)
committermpv <mpv@opencascade.com>
Fri, 29 Apr 2016 14:56:37 +0000 (17:56 +0300)
src/Model/Model_Document.cpp

index baf6fe686c0fa908291ee98b5f2c25c28942a2a9..b0960472f2ff5245bfc33c80606c6420c028aaa4 100755 (executable)
@@ -1299,6 +1299,15 @@ std::shared_ptr<ModelAPI_Feature> Model_Document::producedByFeature(
   if (aShape.IsNull())
     return FeaturePtr();
 
+  // for comsolids and compounds all the naming is located in the main object, so, try to use
+  // it first
+  ResultCompSolidPtr aMain = ModelAPI_Tools::compSolidOwner(theResult);
+  if (aMain.get()) {
+    FeaturePtr aMainRes = producedByFeature(aMain, theShape);
+    if (aMainRes)
+      return aMainRes;
+  }
+
   std::shared_ptr<Model_Data> aBodyData = std::dynamic_pointer_cast<Model_Data>(theResult->data());
   if (!aBodyData.get() || !aBodyData->isValid())
     return FeaturePtr();