From: mpv Date: Thu, 11 Sep 2014 05:47:57 +0000 (+0400) Subject: Issue #99 fix X-Git-Tag: V_0.4.4~69^2~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9a148f9505c1606890e6269d133fc6d746384d6e;p=modules%2Fshaper.git Issue #99 fix --- diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 9df4d10f0..875d22dd1 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +80,25 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) aMustbeUpdated = true; } } + // reference to attribute or object + list > aRefAttrs = theFeature->data()->attributes( + ModelAPI_AttributeRefAttr::type()); + for (aRefsIter = aRefAttrs.begin(); aRefsIter != aRefAttrs.end(); aRefsIter++) { + boost::shared_ptr aRef = + boost::dynamic_pointer_cast(*aRefsIter); + if (!aRef) continue; + if (aRef->isObject()) { + boost::shared_ptr aSub = aRef->object(); + if (updateObject(aSub)) { + aMustbeUpdated = true; + } + } else if (aRef->attr()) { // reference to the attribute + boost::shared_ptr aSub = aRef->attr()->owner(); + if (updateObject(aSub)) { + aMustbeUpdated = true; + } + } + } // lists of references aRefs = theFeature->data()->attributes(ModelAPI_AttributeRefList::type()); for (aRefsIter = aRefs.begin(); aRefsIter != aRefs.end(); aRefsIter++) {