+//=================================================================================================
+void FeaturesPlugin_CompositeBoolean::addSubShapes (const GeomShapePtr theCompound,
+ const ListOfShape& theSubShapesToAvoid,
+ ListOfShape& theSubShapesToAdd) {
+ for (GeomAPI_ShapeIterator aCompoundIt (theCompound);
+ aCompoundIt.more();
+ aCompoundIt.next()) {
+ GeomShapePtr aCompoundSS = aCompoundIt.current();
+ ListOfShape::const_iterator aUseIt = theSubShapesToAvoid.cbegin();
+ for (; aUseIt != theSubShapesToAvoid.cend(); aUseIt++) {
+ if (aCompoundSS->isEqual(*aUseIt)) {
+ break;
+ }
+ }
+ if (aUseIt == theSubShapesToAvoid.cend()) {
+ if (aCompoundSS->shapeType() == GeomAPI_Shape::COMPSOLID ||
+ aCompoundSS->shapeType() == GeomAPI_Shape::COMPOUND) {
+ addSubShapes(aCompoundSS, theSubShapesToAvoid, theSubShapesToAdd);
+ }
+ else {
+ theSubShapesToAdd.push_back(aCompoundSS);
+ }
+ }
+ }
+}
+