#include <string>
#include <boost/shared_ptr.hpp>
-class ModelAPI_Feature;
+class ModelAPI_Object;
/**\class ModelAPI_Attribute
* \ingroup DataModel
class ModelAPI_Attribute
{
///< needed here to emit signal that feature changed on change of the attribute
- boost::shared_ptr<ModelAPI_Feature> myFeature;
+ boost::shared_ptr<ModelAPI_Object> myObject;
+protected: // accessible from the attributes
+ bool myIsInitialized;
public:
/// Returns the type of this class of attributes, not static method
MODELAPI_EXPORT virtual ~ModelAPI_Attribute() {}
/// Sets the owner of this attribute
- MODELAPI_EXPORT void setFeature(const boost::shared_ptr<ModelAPI_Feature>& theFeature)
- {myFeature = theFeature;}
+ MODELAPI_EXPORT void setObject(const boost::shared_ptr<ModelAPI_Object>& theObject)
+ {myObject = theObject;}
/// Returns the owner of this attribute
- MODELAPI_EXPORT const boost::shared_ptr<ModelAPI_Feature>& feature()
- {return myFeature;}
+ MODELAPI_EXPORT const boost::shared_ptr<ModelAPI_Object>& owner()
+ {return myObject;}
+
+ /// 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;}
};