- for(int aFaceIndex = 0; aFaceIndex < aFacesNum || aFacesNum == -1; aFaceIndex++) {
- ResultBodyPtr aResultBody;
-
-#ifdef DEBUG_COMPSOLID_SHAPE
- if (aFirstShapeInCompsolid && anIndex == 0)
- aResultBody = aCompSolidResult;
- else {
-#endif
-
-#ifdef DEBUG_COMPSOLID
- aResultBody = aCompSolidResult->addResult(aResultIndex);
-#else
- aResultBody = document()->createBody(data(), aResultIndex);
-#endif
-
-#ifdef DEBUG_COMPSOLID_SHAPE
- }
-#endif
- std::shared_ptr<GeomAPI_Shape> aBaseShape;
- if (aFacesNum == -1) {
- aBaseShape = aValueFace;
- } else {
- aBaseShape = std::dynamic_pointer_cast<GeomAPI_Shape>(aConstruction->face(aFaceIndex));
- }
-
- GeomAlgoAPI_Prism aFeature(aBaseShape, aToShape, aToSize, aFromShape, aFromSize);
- if(!aFeature.isDone()) {
- static const std::string aFeatureError = "Extrusion algorithm failed";
- setError(aFeatureError);
- break;
- }
-
- // Check if shape is valid
- if(!aFeature.shape().get() || aFeature.shape()->isNull()) {
- static const std::string aShapeError = "Resulting shape is Null";
- setError(aShapeError);
- break;
- }
- if(!aFeature.isValid()) {
- std::string aFeatureError = "Warning: resulting shape is not valid";
- setError(aFeatureError);
- break;
- }
- //LoadNamingDS
- LoadNamingDS(aFeature, aResultBody, aBaseShape, aContext);
- setResult(aResultBody, aResultIndex);
- aResultIndex++;
-
- if (aFacesNum == -1)
- break;