]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Objects.cpp
Salome HOME
Parts results and activation/deactivation management (show/hide also)
[modules/shaper.git] / src / Model / Model_Objects.cpp
index 1b8e3253b9eda85fc235449e940f623707305434..5d27392b94eee04a3880e2398d97907f43a33870 100644 (file)
@@ -341,7 +341,7 @@ ObjectPtr Model_Objects::object(const std::string& theGroupID, const int theInde
 {
   createHistory(theGroupID);
   //TODO: mpv stabilization hotfix
-  if (myHistory[theGroupID].size() <= theIndex)
+  if (myHistory[theGroupID].size() <= (const unsigned int)theIndex)
     return ObjectPtr();
   return myHistory[theGroupID][theIndex];
 }
@@ -816,8 +816,10 @@ void Model_Objects::updateResults(FeaturePtr theFeature)
         if (aGroup->Get() == ModelAPI_ResultBody::group().c_str()) {
           aNewBody = createBody(theFeature->data(), aResIndex);
         } else if (aGroup->Get() == ModelAPI_ResultPart::group().c_str()) {
-          //aNewBody = createPart(theFeature->data(), aResIndex); 
-          theFeature->execute(); // create the part result
+          std::shared_ptr<ModelAPI_ResultPart> aNewP = createPart(theFeature->data(), aResIndex); 
+          theFeature->setResult(aNewP, aResIndex);
+          if (!aNewP->partDoc().get())
+            theFeature->execute(); // create the part result: it is better to restore the previous result if it is possible
           break;
         } else if (aGroup->Get() == ModelAPI_ResultConstruction::group().c_str()) {
           theFeature->execute(); // construction shapes are needed for sketch solver