]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Another fix for the issue #19039 Can't select solids to create a compound
authormpv <mikhail.ponikarov@opencascade.com>
Wed, 6 May 2020 16:21:37 +0000 (19:21 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Wed, 6 May 2020 16:21:37 +0000 (19:21 +0300)
and the issue #19019 Python dump not loadable

src/Model/Model_AttributeSelection.cpp

index 6cd4958d2f525fa7fe19c2b90d11a29ef6a20661..e5a333e35a8e015a29dd69d727e3acefd2dbff83 100644 (file)
@@ -1987,8 +1987,6 @@ ResultPtr Model_AttributeSelection::newestContext(
   const ResultPtr theCurrent, const GeomShapePtr theValue)
 {
   ResultPtr aResult = theCurrent;
-  if (!std::dynamic_pointer_cast<ModelAPI_ResultBody>(aResult).get())
-    return aResult; // construction, groups and other results are not propagated (#19019)
   GeomShapePtr aSelectedShape = theValue.get() ? theValue : theCurrent->shape();
   std::shared_ptr<Model_Document> aDoc =
     std::dynamic_pointer_cast<Model_Document>(owner()->document());
@@ -2074,6 +2072,10 @@ ResultPtr Model_AttributeSelection::newestContext(
             break;
           }
         }
+        if (!aFindNewContext && !aResults.empty()) {
+          // #19019 : result is concealed by object that contains no such sub-shape
+          return theCurrent;
+        }
       }
     }
   }