+
+int GeomAlgoAPI_CompoundBuilder::id(
+ std::shared_ptr<GeomAPI_Shape> theContext, std::shared_ptr<GeomAPI_Shape> theSub)
+{
+ int anID = 0;
+ TopoDS_Shape aMainShape = theContext->impl<TopoDS_Shape>();
+ const TopoDS_Shape& aSubShape = theSub->impl<TopoDS_Shape>();
+ if (!aMainShape.IsNull() && !aSubShape.IsNull()) {
+ TopTools_IndexedMapOfShape aSubShapesMap;
+ TopExp::MapShapes(aMainShape, aSubShapesMap);
+ anID = aSubShapesMap.FindIndex(aSubShape);
+ }
+
+ return anID;
+}