Salome HOME
Recalculate DoF when removing feature without constraints (issue #1456)
[modules/shaper.git] / src / Model / Model_AttributeValidator.cpp
index 9a6c954653200f1ddd1b670d3df2d8928773294c..93e32183232445a6c22320e974106e371cdd34f6 100644 (file)
@@ -5,7 +5,10 @@
 // Author:      Sergey POKHODENKO
 
 #include "Model_AttributeValidator.h"
+
 #include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeInteger.h>
+
 #include <GeomDataAPI_Point.h>
 #include <GeomDataAPI_Point2D.h>
 
@@ -13,6 +16,14 @@ bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute,
                                        const std::list<std::string>& theArguments, 
                                        std::string& theError) const
 {
+  if (theAttribute->attributeType() == ModelAPI_AttributeInteger::typeId()) {
+    AttributeIntegerPtr anAttribue =
+        std::dynamic_pointer_cast<ModelAPI_AttributeInteger>(theAttribute);
+    if (!anAttribue->expressionError().empty()) {
+      theError = anAttribue->expressionError();
+      return false;
+    }
+  } else
   if (theAttribute->attributeType() == ModelAPI_AttributeDouble::typeId()) {
     AttributeDoublePtr anAttribue = 
         std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(theAttribute);