+static void prepareShapes(const TopoDS_Shape& theShape,
+ TopTools_ListOfShape& theSimpleList)
+{
+ if (theShape.ShapeType() != TopAbs_COMPOUND) {
+ theSimpleList.Append(theShape);
+ return;
+ }
+
+ // explode compound on simple shapes to allow their intersections
+ TopoDS_Iterator It (theShape, Standard_True, Standard_True);
+ for (; It.More(); It.Next()) {
+ TopoDS_Shape curSh = It.Value();
+ prepareShapes(curSh, theSimpleList);
+ }
+}