X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelGeomAlgo%2FModelGeomAlgo_Shape.cpp;h=207e4f3aa807ce4c1b861cd4f76df85927b0a26c;hb=b7ec3c27f028060b3c42b7da6fa3dfe962fe26e4;hp=e635ebf8b957291ea8fb397f9975fe20c4240789;hpb=c4eab94a20a0d93100549a210582d46409fec1cc;p=modules%2Fshaper.git diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Shape.cpp b/src/ModelGeomAlgo/ModelGeomAlgo_Shape.cpp index e635ebf8b..207e4f3aa 100644 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Shape.cpp +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Shape.cpp @@ -130,6 +130,19 @@ namespace ModelGeomAlgo_Shape aSR.myResult = theResult; aSR.mySubshape = theSubshape; aSR.myCenterType = theCenterType; + // compound subshapes from other compounds should be processed as whole results + if (aSR.mySubshape && aSR.mySubshape->shapeType() == GeomAPI_Shape::COMPOUND && + !theResult->shape()->isEqual(theSubshape)) { + ResultBodyPtr aResult = std::dynamic_pointer_cast(theResult); + for (int i = 0; aResult && i < aResult->numberOfSubs(); ++i) { + ResultBodyPtr aSub = aResult->subResult(i); + if (aSub->shape()->isEqual(theSubshape)) { + aSR.myResult = aSub; + aSR.mySubshape = GeomShapePtr(); + break; + } + } + } theList.push_back(aSR); } @@ -138,13 +151,8 @@ namespace ModelGeomAlgo_Shape const std::list& theSubshape) { for (std::list::const_iterator anIt = theSubshape.begin(); - anIt != theSubshape.end(); ++anIt) { - SubshapeOfResult aSR; - aSR.myResult = theResult; - aSR.mySubshape = *anIt; - aSR.myCenterType = (int)ModelAPI_AttributeSelection::NOT_CENTER; - theList.push_back(aSR); - } + anIt != theSubshape.end(); ++anIt) + appendSubshapeOfResult(theList, theResult, *anIt); } static bool findSubshapeInCompsolid(const ResultBodyPtr& theCompsolid,