X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Attribute.h;h=acea353df4d61d3be87566b1ea1da3232a3fe844;hb=7f5d3b6de3d879b6a11389c06a6f183b2fa5a1b2;hp=cd7d36a549b2a384059494ca21d4ff64a538b4a6;hpb=499d70af8b5a0301b1d1260dc19455dc4fab7978;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Attribute.h b/src/ModelAPI/ModelAPI_Attribute.h index cd7d36a54..acea353df 100644 --- a/src/ModelAPI/ModelAPI_Attribute.h +++ b/src/ModelAPI/ModelAPI_Attribute.h @@ -7,23 +7,37 @@ #include "ModelAPI.h" #include +#include + +class ModelAPI_Feature; /**\class ModelAPI_Attribute * \ingroup DataModel * \brief Generic attribute of the Object. */ - -class MODELAPI_EXPORT ModelAPI_Attribute +class ModelAPI_Attribute { + ///< needed here to emit signal that feature changed on change of the attribute + boost::shared_ptr myFeature; public: /// Returns the type of this class of attributes, not static method - virtual std::string attributeType() = 0; + MODELAPI_EXPORT virtual std::string attributeType() = 0; + + /// To virtually destroy the fields of successors + MODELAPI_EXPORT virtual ~ModelAPI_Attribute() {} + /// Sets the owner of this attribute + MODELAPI_EXPORT void setFeature(const boost::shared_ptr& theFeature) + {myFeature = theFeature;} + + /// Returns the owner of this attribute + MODELAPI_EXPORT const boost::shared_ptr& owner() + {return myFeature;} protected: /// Objects are created for features automatically - ModelAPI_Attribute() - {} + ModelAPI_Attribute(){} + }; #endif