From d4e7e93510935c23c13f7ba15e5a4b4382014cdc Mon Sep 17 00:00:00 2001 From: Clarisse Genrault Date: Wed, 22 Mar 2017 15:43:57 +0100 Subject: [PATCH] Fix bug on messages error. --- .../FeaturesPlugin_MultiTranslation.cpp | 3 +++ src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp | 4 ++-- src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp | 24 +++++++++---------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp b/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp index 7bddd8e17..7be4cccf2 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp @@ -113,6 +113,7 @@ void FeaturesPlugin_MultiTranslation::performOneDirection() std::string aFeatureError = "Multitranslation builder "; aFeatureError+=":: the number of copies for the first direction is null or negative."; setError(aFeatureError); + return; } // Moving each object. @@ -248,12 +249,14 @@ void FeaturesPlugin_MultiTranslation::performTwoDirection() std::string aFeatureError = "Multitranslation builder "; aFeatureError+=":: the number of copies for the first direction is null or negative."; setError(aFeatureError); + return; } if (aSecondNbCopies <=0) { std::string aFeatureError = "Multitranslation builder "; aFeatureError+=":: the number of copies for the second direction is null or negative."; setError(aFeatureError); + return; } // Coord aFirstAxis diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp index 9af02de5f..9041474ed 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp @@ -66,7 +66,7 @@ bool GeomAlgoAPI_Rotation::check() } case BY_POINTS: { if (!myCenterPoint) { - myError = "Rotation builder :: start point is not valid."; + myError = "Rotation builder :: center point is not valid."; return false; } if (!myStartPoint) { @@ -74,7 +74,7 @@ bool GeomAlgoAPI_Rotation::check() return false; } if (!myEndPoint) { - myError = "Rotation builder :: start point is not valid."; + myError = "Rotation builder :: end point is not valid."; return false; } if (!mySourceShape) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp index d4b94f822..83ee6e5fc 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp @@ -411,15 +411,15 @@ namespace GeomAlgoAPI_ShapeAPI const double theStep, const int theNumber) throw (GeomAlgoAPI_Exception) { - if (theNumber <=0) { + if (!theAxis) { std::string aError = "Multitranslation builder "; - aError+=":: the number of copies for the first direction is null or negative."; + aError+=":: the first axis is not valid"; throw GeomAlgoAPI_Exception(aError); } - if (!theAxis) { + if (theNumber <=0) { std::string aError = "Multitranslation builder "; - aError+=":: the first axis is not valid"; + aError+=":: the number of copies for the first direction is null or negative."; throw GeomAlgoAPI_Exception(aError); } @@ -441,27 +441,27 @@ namespace GeomAlgoAPI_ShapeAPI const double theSecondStep, const int theSecondNumber) throw (GeomAlgoAPI_Exception) { - if (theFirstNumber <=0) { + if (!theFirstAxis) { std::string aError = "Multitranslation builder "; - aError+=":: the number of copies for the first direction is null or negative."; + aError+=":: the first axis is not valid"; throw GeomAlgoAPI_Exception(aError); } - if (theSecondNumber <=0) { + if (!theSecondAxis) { std::string aError = "Multitranslation builder "; - aError+=":: the number of copies for the second direction is null or negative."; + aError+=":: the second axis is not valid"; throw GeomAlgoAPI_Exception(aError); } - if (!theFirstAxis) { + if (theFirstNumber <=0) { std::string aError = "Multitranslation builder "; - aError+=":: the first axis is not valid"; + aError+=":: the number of copies for the first direction is null or negative."; throw GeomAlgoAPI_Exception(aError); } - if (!theSecondAxis) { + if (theSecondNumber <=0) { std::string aError = "Multitranslation builder "; - aError+=":: the second axis is not valid"; + aError+=":: the number of copies for the second direction is null or negative."; throw GeomAlgoAPI_Exception(aError); } -- 2.39.2