X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Objects.cpp;h=1361a931a49baca81ba39b0b83ee3ac10d237a62;hb=5183e45dbb598541fb76e679b285b1e599916eaa;hp=1b8e3253b9eda85fc235449e940f623707305434;hpb=f8f03f6e3b092381922b2703670ce57440714839;p=modules%2Fshaper.git diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 1b8e3253b..1361a931a 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -339,10 +339,9 @@ ObjectPtr Model_Objects::object(TDF_Label theLabel) ObjectPtr Model_Objects::object(const std::string& theGroupID, const int theIndex) { - createHistory(theGroupID); - //TODO: mpv stabilization hotfix - if (myHistory[theGroupID].size() <= theIndex) + if (theIndex == -1) return ObjectPtr(); + createHistory(theGroupID); return myHistory[theGroupID][theIndex]; } @@ -816,8 +815,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 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