From: dbv Date: Fri, 2 Sep 2016 12:01:07 +0000 (+0300) Subject: Issue #1711: Dump study/Load saved script - tuple index out of range X-Git-Tag: V_2.5.0~74 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fa9ee8f2857fa15ee80664670086e4c838f52947;p=modules%2Fshaper.git Issue #1711: Dump study/Load saved script - tuple index out of range Fixed --- diff --git a/src/FeaturesAPI/FeaturesAPI_Extrusion.cpp b/src/FeaturesAPI/FeaturesAPI_Extrusion.cpp index bb2cb99ac..62f0d0470 100644 --- a/src/FeaturesAPI/FeaturesAPI_Extrusion.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Extrusion.cpp @@ -113,6 +113,10 @@ FeaturesAPI_Extrusion::~FeaturesAPI_Extrusion() void FeaturesAPI_Extrusion::setNestedSketch(const ModelHighAPI_Reference& theSketch) { mysketch->setValue(theSketch.feature()); + + // To make Sketch feature execute and subfeatures execute. + feature()->document()->setCurrentFeature(feature(), false); + // to inform that the history is updated due to the sketch moved under the composite feature if (theSketch.feature().get()) { theSketch.feature()->document()->updateHistory(ModelAPI_Feature::group()); diff --git a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp index 26307f4e7..974f07694 100644 --- a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp @@ -26,6 +26,10 @@ FeaturesAPI_ExtrusionBoolean::~FeaturesAPI_ExtrusionBoolean() void FeaturesAPI_ExtrusionBoolean::setNestedSketch(const ModelHighAPI_Reference& theSketch) { mysketch->setValue(theSketch.feature()); + + // To make Sketch feature execute and subfeatures execute. + feature()->document()->setCurrentFeature(feature(), false); + // to inform that the history is updated due to the sketch moved under the composite feature if (theSketch.feature().get()) { theSketch.feature()->document()->updateHistory(ModelAPI_Feature::group()); diff --git a/src/FeaturesAPI/FeaturesAPI_Revolution.cpp b/src/FeaturesAPI/FeaturesAPI_Revolution.cpp index 061a97457..173a61594 100644 --- a/src/FeaturesAPI/FeaturesAPI_Revolution.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Revolution.cpp @@ -74,6 +74,10 @@ FeaturesAPI_Revolution::~FeaturesAPI_Revolution() void FeaturesAPI_Revolution::setNestedSketch(const ModelHighAPI_Reference& theSketch) { mysketch->setValue(theSketch.feature()); + + // To make Sketch feature execute and subfeatures execute. + feature()->document()->setCurrentFeature(feature(), false); + // to inform that the history is updated due to the sketch moved under the composite feature if (theSketch.feature().get()) { theSketch.feature()->document()->updateHistory(ModelAPI_Feature::group()); diff --git a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp index 118bd2fe8..cf897c960 100644 --- a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp @@ -26,6 +26,10 @@ FeaturesAPI_RevolutionBoolean::~FeaturesAPI_RevolutionBoolean() void FeaturesAPI_RevolutionBoolean::setNestedSketch(const ModelHighAPI_Reference& theSketch) { mysketch->setValue(theSketch.feature()); + + // To make Sketch feature execute and subfeatures execute. + feature()->document()->setCurrentFeature(feature(), false); + // to inform that the history is updated due to the sketch moved under the composite feature if (theSketch.feature().get()) { theSketch.feature()->document()->updateHistory(ModelAPI_Feature::group());