From: vsv Date: Thu, 29 Jan 2015 12:01:24 +0000 (+0300) Subject: Issue #378: Take into account sub-objects of composite feature in ModuleBase_Operatio... X-Git-Tag: V_1.0.0~13^2~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6ee4c5c90f88523bd433b4a9660d0262bc0261f3;p=modules%2Fshaper.git Issue #378: Take into account sub-objects of composite feature in ModuleBase_Operation::hasObject --- diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index 96060b463..3b799f668 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -131,6 +131,20 @@ bool ModuleBase_Operation::hasObject(ObjectPtr theObj) const if (theObj == (*aIt)) return true; } + CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast(aFeature); + if (aCompFeature.get() != NULL) { + for (int i = 0; i < aCompFeature->numberOfSubs(); i++) { + FeaturePtr aSubFeature = aCompFeature->subFeature(i); + std::list aResults = aSubFeature->results(); + std::list::const_iterator aIt; + for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) { + if (theObj == (*aIt)) + return true; + } + if (aSubFeature == theObj) + return true; + } + } } return false; }