Salome HOME
Added the system of reinitialization of attributes instead of re-creation of them...
[modules/shaper.git] / src / Model / Model_AttributeInteger.cpp
index 38ce002c5271c01206c0d66f80795047984de6a7..3f61cbd966561b8f2598c913ad3cb54e10d35589 100644 (file)
@@ -8,12 +8,20 @@
 
 #include <ModelAPI_Data.h>
 #include <ModelAPI_Events.h>
-#include <ModelAPI_Expression.h>
+#include <Model_Expression.h>
 #include <ModelAPI_Object.h>
 
-Model_AttributeInteger::Model_AttributeInteger()
+Model_AttributeInteger::Model_AttributeInteger(TDF_Label& theLabel)
 {
-  myIsInitialized = false;
+  // to the same label to support the backward compatibility
+  myExpression.reset(new Model_ExpressionInteger(theLabel));
+  myIsInitialized = myExpression->isInitialized();
+}
+
+void Model_AttributeInteger::reinit()
+{
+  myExpression->reinit();
+  myIsInitialized = myExpression->isInitialized();
 }
 
 void Model_AttributeInteger::setCalculatedValue(const int theValue)