X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_CompoundBuilder.cpp;h=48d430fad38db7a0d5c34357a9170651f6f348a6;hb=f0cec241aae9ca16d86e166f45cb5c4987d2c792;hp=a988d3bb2a8dfd798efdc027e0619347032b34e6;hpb=38afbd899a8645c83e17f2c24a17a2b7414911b4;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp index a988d3bb2..48d430fad 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp @@ -5,11 +5,10 @@ // Author: Natalia ERMOLAEVA #include -//#include -//#include -//#include #include #include +#include +#include std::shared_ptr GeomAlgoAPI_CompoundBuilder::compound( std::list > theShapes) @@ -28,3 +27,18 @@ std::shared_ptr GeomAlgoAPI_CompoundBuilder::compound( aRes->setImpl(new TopoDS_Shape(aComp)); return aRes; } + +int GeomAlgoAPI_CompoundBuilder::id( + std::shared_ptr theContext, std::shared_ptr theSub) +{ + int anID = 0; + TopoDS_Shape aMainShape = theContext->impl(); + const TopoDS_Shape& aSubShape = theSub->impl(); + if (!aMainShape.IsNull() && !aSubShape.IsNull()) { + TopTools_IndexedMapOfShape aSubShapesMap; + TopExp::MapShapes(aMainShape, aSubShapesMap); + anID = aSubShapesMap.FindIndex(aSubShape); + } + + return anID; +}