Salome HOME
Remove unnecessary variable
[modules/shaper.git] / src / GeomValidators / GeomValidators_ZeroOffset.cpp
index 4bfe414a19f16627ee8e428ef33b5a6362ecc764..9f0d5ede126e960a298332853fdb89c657d9495a 100644 (file)
 
 //=================================================================================================
 bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                        const std::list<std::string>& theArguments) const
+                                        const std::list<std::string>& theArguments,
+                                        std::string& theError) const
 {
   if(theArguments.size() != 8) {
+    theError = "Wrong number of arguments (expected 8).";
     return false;
   }
 
@@ -42,7 +44,8 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
   anIt++;
 
   if(aSelectedMethod == aCreationMethod) {
-    if(aToSize == 0.0 && aFromSize == 0.0) {
+    if(aToSize == -aFromSize) {
+      theError = "ToSize = -FromSize.";
       return false;
     } else {
       return true;
@@ -82,7 +85,8 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
   }
 
   if(((!aFromShape && !aToShape) || ((aFromShape && aToShape) && aFromShape->isEqual(aToShape)))
-    && (aFromSize == 0.0 && aToSize == 0.0)) {
+    && (aFromSize == -aToSize)) {
+    theError = "FromSize = -ToSize and bounding planes are equal.";
     return false;
   }