From: Clarisse Genrault Date: Fri, 17 Mar 2017 10:50:39 +0000 (+0100) Subject: Fix bug for translation (id 2237 and id 2250). X-Git-Tag: V_2.7.0~215 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c479ee86c98acd567b30f0a85b50342c55665532;p=modules%2Fshaper.git Fix bug for translation (id 2237 and id 2250). --- 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 c593215ec..d4b94f822 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp @@ -412,8 +412,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); } @@ -436,14 +442,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); }