X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_CompoundBuilder.cpp;h=48d430fad38db7a0d5c34357a9170651f6f348a6;hb=f0cec241aae9ca16d86e166f45cb5c4987d2c792;hp=8ce54d347adf98d35701495bd93121c587cab445;hpb=4783f146b71a48c651523fcf0e12367bcf3d1fa8;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp index 8ce54d347..48d430fad 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp @@ -1,13 +1,14 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomAlgoAPI_CompoundBuilder.cpp // Created: 24 Apr 2014 // Author: Natalia ERMOLAEVA #include -//#include -//#include -//#include #include #include +#include +#include std::shared_ptr GeomAlgoAPI_CompoundBuilder::compound( std::list > theShapes) @@ -26,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; +}