Salome HOME
[bos #26534] EDF 24265 - Problem of recover in TUI
authorjfa <jfa@opencascade.com>
Tue, 19 Oct 2021 09:41:23 +0000 (12:41 +0300)
committerjfa <jfa@opencascade.com>
Tue, 19 Oct 2021 09:41:23 +0000 (12:41 +0300)
src/FeaturesAPI/FeaturesAPI_Recover.cpp
src/ModelHighAPI/ModelHighAPI_Reference.cpp

index b4de32a66b69bc26a635096b52daee4703bc2b67..15d1ff9cac52d7aa27b4b903a08a3098673a54c1 100644 (file)
@@ -37,12 +37,12 @@ FeaturesAPI_Recover::FeaturesAPI_Recover(const std::shared_ptr<ModelAPI_Feature>
   const bool theRecoverCompound)
 : ModelHighAPI_Interface(theFeature)
 {
-  if(initialize()) {
+  if (initialize()) {
     std::string aMethod = theRecoverCompound ? FeaturesPlugin_Recover::METHOD_COMPOUND()
                                              : FeaturesPlugin_Recover::METHOD_DEFAULT();
     fillAttribute(aMethod, theFeature->string(FeaturesPlugin_Recover::METHOD()));
 
-    setBaseFeature(theBaseFeature);
+    fillAttribute(theBaseFeature.feature(), mybaseFeature);
     setRecoveredList(theRecoveredList);
   }
 }
index 3d4df7a1019b39897bd68af475fbd438aff65243..b381d4fd761901bd9afe07eca599de97aa06f256 100644 (file)
@@ -41,6 +41,11 @@ ModelHighAPI_Reference::ModelHighAPI_Reference(
   if (!myObject) {
     theValue->execute(true);
     myObject = std::shared_ptr<ModelAPI_Object>(theValue->defaultResult());
+    if (!myObject) {
+      // [bos #26534] EDF 24265 - Problem of recover in TUI
+      // Feature can have no results, store the feature itself
+      myObject = std::shared_ptr<ModelAPI_Object>(theValue->feature());
+    }
   }
 }