Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / ModelAPI / ModelAPI_Attribute.h
index cd7d36a549b2a384059494ca21d4ff64a538b4a6..acea353df4d61d3be87566b1ea1da3232a3fe844 100644 (file)
@@ -7,23 +7,37 @@
 
 #include "ModelAPI.h"
 #include <string>
+#include <boost/shared_ptr.hpp>
+
+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<ModelAPI_Feature> 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<ModelAPI_Feature>& theFeature)
+    {myFeature = theFeature;}
+
+  /// Returns the owner of this attribute
+  MODELAPI_EXPORT const boost::shared_ptr<ModelAPI_Feature>& owner()
+  {return myFeature;}
 protected:
   /// Objects are created for features automatically
-  ModelAPI_Attribute()
-  {}
+  ModelAPI_Attribute(){}
+
 };
 
 #endif