X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Tools.cpp;h=45398077f6f74fd50603f75f5d93ebc09db61055;hb=64fc7e4fdd63997ec7a502b233ef5f88186d5bbb;hp=5663298017804a0df23d6a3d9e61bfea31f51872;hpb=82d3fff7d0ed2c089da5aa6b106789be076081f3;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index 566329801..45398077f 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -174,7 +174,7 @@ bool isSubOfComposite(const ObjectPtr& theObject, const FeaturePtr& theFeature) //************************************************************** void refsToFeatureInAllDocuments(const ObjectPtr& theSourceObject, const ObjectPtr& theObject, - std::set& theRefFeatures) + std::set& theDirectRefFeatures, std::set& theIndirectRefFeatures) { FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); if (!aFeature.get()) @@ -187,7 +187,7 @@ void refsToFeatureInAllDocuments(const ObjectPtr& theSourceObject, const ObjectP aLast = aRefFeatures.end(); for (; anIt != aLast; anIt++) { if (!isSubOfComposite(theSourceObject, *anIt)) - theRefFeatures.insert(*anIt); + theDirectRefFeatures.insert(*anIt); } // 2. find references in all documents if the document of the feature is @@ -242,19 +242,19 @@ void refsToFeatureInAllDocuments(const ObjectPtr& theSourceObject, const ObjectP } } if (aHasReferenceToObject && !isSubOfComposite(theSourceObject, aFeature)) - theRefFeatures.insert(aFeature); + theDirectRefFeatures.insert(aFeature); } } } - // Run recursion. It is possible recusive dependency, like the folowing: plane, extrusion uses plane, + // Run recursion. It is possible recursive dependency, like the following: plane, extrusion uses plane, // axis is built on extrusion. Delete of a plane should check the dependency from the axis also. std::set aRecursiveRefFeatures; - std::set::const_iterator aFeatureIt = theRefFeatures.begin(); - for (; aFeatureIt != theRefFeatures.end(); ++aFeatureIt) { - refsToFeatureInAllDocuments(theSourceObject, *aFeatureIt, aRecursiveRefFeatures); + std::set::const_iterator aFeatureIt = theDirectRefFeatures.begin(); + for (; aFeatureIt != theDirectRefFeatures.end(); ++aFeatureIt) { + refsToFeatureInAllDocuments(theSourceObject, *aFeatureIt, aRecursiveRefFeatures, aRecursiveRefFeatures); } - theRefFeatures.insert(aRecursiveRefFeatures.begin(), aRecursiveRefFeatures.end()); + theIndirectRefFeatures.insert(aRecursiveRefFeatures.begin(), aRecursiveRefFeatures.end()); } }