- // Getting extrusion sizes.
- double aToSize = 0.0;
- double aFromSize = 0.0;
-
- if(string(CREATION_METHOD())->value() == "BySizes") {
- aToSize = real(TO_SIZE_ID())->value();
- aFromSize = real(FROM_SIZE_ID())->value();
- } else {
- aToSize = real(TO_OFFSET_ID())->value();
- aFromSize = real(FROM_OFFSET_ID())->value();
- }
-
- // Getting extrusion bounding planes.
- std::shared_ptr<GeomAPI_Shape> aToShape;
- std::shared_ptr<GeomAPI_Shape> aFromShape;
-
- if(string(CREATION_METHOD())->value() == "ByPlanesAndOffsets") {
- std::shared_ptr<ModelAPI_AttributeSelection> anObjRef = selection(TO_OBJECT_ID());
- if(anObjRef.get() != NULL) {
- aToShape = std::dynamic_pointer_cast<GeomAPI_Shape>(anObjRef->value());
- if(aToShape.get() == NULL && anObjRef->context().get() != NULL) {
- aToShape = anObjRef->context()->shape();
- }
- }
- anObjRef = selection(FROM_OBJECT_ID());
- if(anObjRef.get() != NULL) {
- aFromShape = std::dynamic_pointer_cast<GeomAPI_Shape>(anObjRef->value());
- if(aFromShape.get() == NULL && anObjRef->context().get() != NULL) {
- aFromShape = anObjRef->context()->shape();
- }
- }
- }
-
- // Extrude faces.
- theResults.clear();
- for(ListOfShape::const_iterator aFacesIt = theFaces.begin(); aFacesIt != theFaces.end(); aFacesIt++) {
- std::shared_ptr<GeomAPI_Shape> aBaseShape = *aFacesIt;
- std::shared_ptr<GeomAlgoAPI_Prism> aPrismAlgo = std::shared_ptr<GeomAlgoAPI_Prism>(new GeomAlgoAPI_Prism(aBaseShape, aToShape, aToSize, aFromShape, aFromSize));