-
- for(int aFaceIndex = 0; aFaceIndex < aFacesNum || aFacesNum == -1; aFaceIndex++) {
- ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
- std::shared_ptr<GeomAPI_Shape> aBaseShape;
- if (aFacesNum == -1) {
- aBaseShape = aValueFace;
- } else {
- aBaseShape = std::dynamic_pointer_cast<GeomAPI_Shape>(aConstruction->face(aFaceIndex));
- }
-
- GeomAlgoAPI_Revolution aFeature(aBaseShape, anAxis, aToShape, aToAngle, aFromShape, aFromAngle);
- if(!aFeature.isDone()) {
- static const std::string aFeatureError = "Revolution algorithm failed";
- setError(aFeatureError);
- break;
- }
-
- // Check if shape is valid
- if(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;
+ if(!aRevolAlgo.isValid()) {
+ std::string aPrismAlgoError = "Warning: resulting shape is not valid";
+ setError(aPrismAlgoError);
+ aResultIndex = 0;
+ break;