+bool cutUnusedSubs(CompsolidSubs& theObjects, CompsolidSubs& theNotUsed,
+ std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theMakeShapeList,
+ std::string& theError)
+{
+ GeomShapePtr aFirstArgument = theObjects.front().first;
+
+ // compose a set of tools for the CUT operation:
+ // find the list of unused subs of the first argument or use itself
+ ListOfShape aToolsForUsed;
+ CompsolidSubs::iterator aUIt = theNotUsed.begin();
+ for (; aUIt != theNotUsed.end(); ++aUIt)
+ if (aUIt->first == aFirstArgument) {
+ aToolsForUsed.insert(aToolsForUsed.end(), aUIt->second.begin(), aUIt->second.end());
+ break;
+ }
+ ListOfShape aToolsForUnused;
+ aToolsForUnused.push_back(aFirstArgument);
+
+ // cut subs
+ return cutSubs(aFirstArgument, theObjects, aToolsForUsed, theMakeShapeList, theError)
+ && cutSubs(aFirstArgument, theNotUsed, aToolsForUnused, theMakeShapeList, theError);
+}
+