From: Clarisse Genrault Date: Fri, 17 Mar 2017 10:58:40 +0000 (+0100) Subject: Merge branch 'master' into cgt/devCEA X-Git-Tag: V_2.9.0~50 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8c02cd3212ecefba1d69eb9d63f0cb94c98b0d3c;hp=37d3df3f82d632f471935a042292d5ead9e4a2f9;p=modules%2Fshaper.git Merge branch 'master' into cgt/devCEA --- diff --git a/src/FeaturesAPI/FeaturesAPI_MultiTranslation.cpp b/src/FeaturesAPI/FeaturesAPI_MultiTranslation.cpp index 07732415b..64d434c7d 100644 --- a/src/FeaturesAPI/FeaturesAPI_MultiTranslation.cpp +++ b/src/FeaturesAPI/FeaturesAPI_MultiTranslation.cpp @@ -52,9 +52,9 @@ FeaturesAPI_MultiTranslation::FeaturesAPI_MultiTranslation( fillAttribute(theFirstAxisObject, firstAxisObject()); fillAttribute(theFirstStep, firstStep()); fillAttribute(theFirstNumber, firstNumber()); + fillAttribute(FeaturesPlugin_MultiTranslation::USE_SECOND_DIR_ID(),useSecondDir()); fillAttribute(theSecondAxisObject, secondAxisObject()); fillAttribute(theSecondStep, secondStep()); - fillAttribute("true",useSecondDir()); setSecondNumber(theSecondNumber); } } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp index 160b22beb..e02a28cc5 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp @@ -460,8 +460,14 @@ namespace GeomAlgoAPI_ShapeAPI const int theNumber) throw (GeomAlgoAPI_Exception) { if (theNumber <=0) { - std::string aError = "Multitranslation builder "; - aError+=":: the number of copies for the first direction is null or negative."; + std::string aError = "Multitranslation builder "; + aError+=":: the number of copies for the first direction is null or negative."; + throw GeomAlgoAPI_Exception(aError); + } + + if (!theAxis) { + std::string aError = "Multitranslation builder "; + aError+=":: the first axis is not valid"; throw GeomAlgoAPI_Exception(aError); } @@ -484,14 +490,26 @@ namespace GeomAlgoAPI_ShapeAPI const int theSecondNumber) throw (GeomAlgoAPI_Exception) { if (theFirstNumber <=0) { - std::string aError = "Multitranslation builder "; - aError+=":: the number of copies for the first direction is null or negative."; + std::string aError = "Multitranslation builder "; + aError+=":: the number of copies for the first direction is null or negative."; throw GeomAlgoAPI_Exception(aError); } if (theSecondNumber <=0) { - std::string aError = "Multitranslation builder "; - aError+=":: the number of copies for the second direction is null or negative."; + std::string aError = "Multitranslation builder "; + aError+=":: the number of copies for the second direction is null or negative."; + throw GeomAlgoAPI_Exception(aError); + } + + if (!theFirstAxis) { + std::string aError = "Multitranslation builder "; + aError+=":: the first axis is not valid"; + throw GeomAlgoAPI_Exception(aError); + } + + if (!theSecondAxis) { + std::string aError = "Multitranslation builder "; + aError+=":: the second axis is not valid"; throw GeomAlgoAPI_Exception(aError); }