- std::shared_ptr<GeomAlgoAPI_MakeShape> aVolumeMaker;
- if (!build(anOriginalShapes, aVolumeMaker))
- return;
-
- GeomShapePtr aVolumeRes = aVolumeMaker->shape();
+ AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID());
+ for (int anIndex = 0; anIndex < aSelectionList->size(); ++anIndex) {
+ AttributeSelectionPtr aSelection = aSelectionList->value(anIndex);
+ GeomShapePtr aShape = aSelection->value();
+ if (!aShape.get())
+ aShape = aSelection->context()->shape();
+ anOriginalShapes.push_back(aShape);
+ }
+ std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(
+ new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
+ GeomShapePtr aVolumeRes = anAlgo->shape();