Salome HOME
Added the initialization of attributes flag and "attributes": method that returns...
[modules/shaper.git] / src / ModelAPI / ModelAPI_Attribute.h
index acea353df4d61d3be87566b1ea1da3232a3fe844..4a15abb88c718b680beeff2b45d323c3020426e2 100644 (file)
@@ -19,6 +19,8 @@ class ModelAPI_Attribute
 {
   ///< needed here to emit signal that feature changed on change of the attribute
   boost::shared_ptr<ModelAPI_Feature> myFeature;
+protected: // accessible from the attributes
+  bool myIsInitialized;
 public:
   
   /// Returns the type of this class of attributes, not static method
@@ -34,9 +36,16 @@ public:
   /// Returns the owner of this attribute
   MODELAPI_EXPORT const boost::shared_ptr<ModelAPI_Feature>& owner()
   {return myFeature;}
+
+  /// Returns true if attribute was  initialized by some value
+  MODELAPI_EXPORT bool isInitialized() {return myIsInitialized;}
+
+  /// Makes attribute initialized
+  MODELAPI_EXPORT void setInitialized() {myIsInitialized = true;}
+
 protected:
   /// Objects are created for features automatically
-  ModelAPI_Attribute(){}
+  ModelAPI_Attribute() {myIsInitialized = false;}
 
 };