Salome HOME
Merge branch 'master' into cgt/devCEA
authorClarisse Genrault <clarisse.genrault@cea.fr>
Fri, 17 Mar 2017 10:58:40 +0000 (11:58 +0100)
committerClarisse Genrault <clarisse.genrault@cea.fr>
Fri, 17 Mar 2017 10:58:40 +0000 (11:58 +0100)
src/FeaturesAPI/FeaturesAPI_MultiTranslation.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp

index 07732415b27fc3958d7a5d71f9d978b0ac6ad6ef..64d434c7d88b6d6f2b0b73d7591aeb7698aeea91 100644 (file)
@@ -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);
   }
 }
index 160b22bebaebdf79bc0fc9ce88df9d3ff9b13bf9..e02a28cc5449449847a653e4d248a1823fbb0c1b 100644 (file)
@@ -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);
     }