+ if (aList->isWholeResultAllowed()) { // whole result selection, explode to sub-shapes
+ if (!aSelection.get() || aSelection->isNull()) {
+ ResultPtr aContext = aList->value(a)->context();
+ if (aContext)
+ aSelection = aContext->shape();
+ }
+ if (aSelection && !aSelection->isNull()) {
+ GeomAPI_Shape::ShapeType aType = GeomAPI_Shape::shapeTypeByStr(aList->selectionType());
+ if (aType == aSelection->shapeType()) {
+ if (aShapesMap.bind(aSelection, aSelection))
+ aSubs.push_back(aSelection);
+ } else {
+ for(GeomAPI_ShapeExplorer anExp(aSelection, aType); anExp.more(); anExp.next()) {
+ if (aShapesMap.bind(anExp.current(), anExp.current()))
+ aSubs.push_back(anExp.current());
+ }
+ }
+ }
+ } else { // take selection as it is
+ if (aSelection && !aSelection->isNull()) {
+ if (aShapesMap.bind(aSelection, aSelection))
+ aSubs.push_back(aSelection);
+ }