1 // File: ModelAPI_AttributeRefAttr.h
3 // Author: Mikhail PONIKAROV
5 #ifndef ModelAPI_AttributeRefAttr_HeaderFile
6 #define ModelAPI_AttributeRefAttr_HeaderFile
8 #include "ModelAPI_Attribute.h"
9 #include "ModelAPI_Feature.h"
11 /**\class ModelAPI_AttributeRefAttr
13 * \brief Attribute that contains reference to an attribute of a feature or reference to
14 * a feature (switchable)
17 class ModelAPI_AttributeRefAttr : public ModelAPI_Attribute
20 /// Returns true if this attribute references to a feature (not to the attribute)
21 MODELAPI_EXPORT virtual bool isFeature() = 0;
23 /// Defines the reference to the attribute
24 MODELAPI_EXPORT virtual void setAttr(boost::shared_ptr<ModelAPI_Attribute> theAttr) = 0;
26 /// Returns attribute referenced from this attribute
27 MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Attribute> attr() = 0;
29 /// Defines the reference to the feature
30 MODELAPI_EXPORT virtual void setFeature(FeaturePtr theFeature) = 0;
32 /// Returns feature referenced from this attribute
33 MODELAPI_EXPORT virtual FeaturePtr feature() = 0;
35 /// Returns the type of this class of attributes
36 MODELAPI_EXPORT static std::string type() {return "RefAttr";}
38 /// Returns the type of this class of attributes, not static method
39 MODELAPI_EXPORT virtual std::string attributeType() {return type();}
41 /// To virtually destroy the fields of successors
42 MODELAPI_EXPORT virtual ~ModelAPI_AttributeRefAttr() {}
45 /// Objects are created for features automatically
46 MODELAPI_EXPORT ModelAPI_AttributeRefAttr()