X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Data.h;h=eea1d1ae87ac75bbc9f4c614edb2907467d4cc14;hb=3fc71e869245e8033a774a759df0e8f214183720;hp=2922f6d9b3891b4875e51e509a96a4d401670c94;hpb=502609e3fb08fe0ac9ffd1cfa3025f67189391ca;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Data.h b/src/ModelAPI/ModelAPI_Data.h index 2922f6d9b..eea1d1ae8 100644 --- a/src/ModelAPI/ModelAPI_Data.h +++ b/src/ModelAPI/ModelAPI_Data.h @@ -7,12 +7,18 @@ #include "ModelAPI.h" #include +#include #include class ModelAPI_AttributeDocRef; class ModelAPI_AttributeDouble; +class ModelAPI_AttributeReference; +class ModelAPI_AttributeRefAttr; +class ModelAPI_AttributeRefList; +class ModelAPI_AttributeBoolean; class ModelAPI_Document; class ModelAPI_Attribute; +class GeomAPI_Shape; /**\class ModelAPI_Data * \ingroup DataModel @@ -25,7 +31,7 @@ class MODELAPI_EXPORT ModelAPI_Data public: /// Returns the name of the feature visible by the user in the object browser - virtual std::string getName() = 0; + virtual std::string name() = 0; /// Defines the name of the feature visible by the user in the object browser virtual void setName(std::string theName) = 0; @@ -34,10 +40,29 @@ public: virtual boost::shared_ptr docRef(const std::string theID) = 0; /// Returns the attribute that contains real value with double precision virtual boost::shared_ptr real(const std::string theID) = 0; + /// Returns the attribute that contains reference to a feature + virtual boost::shared_ptr reference(const std::string theID) = 0; + /// Returns the attribute that contains reference to an attribute of a feature + virtual boost::shared_ptr refattr(const std::string theID) = 0; + /// Returns the attribute that contains list of references to features + virtual boost::shared_ptr reflist(const std::string theID) = 0; + /// Returns the attribute that contains boolean value + virtual boost::shared_ptr boolean(const std::string theID) = 0; /// Returns the generic attribute by identifier /// \param theID identifier of the attribute virtual boost::shared_ptr attribute(const std::string theID) = 0; + /// Returns all attributes ofthe feature of the given type + /// or all attributes if "theType" is empty + virtual std::list > + attributes(const std::string theType) = 0; + /// Identifier by the id (not fast, iteration by map) + /// \param theAttr attribute already created in this data + virtual const std::string& id(const boost::shared_ptr theAttr) = 0; + /// Returns true if data belongs to same features + virtual bool isEqual(const boost::shared_ptr theData) = 0; + /// Returns true if it is correctly connected t othe data model + virtual bool isValid() = 0; /// Initializes object by the attributes: must be called just after the object is created /// for each attribute of the object @@ -45,6 +70,10 @@ public: /// \param theAttrType type of the created attribute (received from the type method) virtual void addAttribute(std::string theID, std::string theAttrType) = 0; + /// Useful method for "set" methods of the attributes: sends an UPDATE event and + /// makes attribute initialized + virtual void sendAttributeUpdated(ModelAPI_Attribute* theAttr) = 0; + /// To virtually destroy the fields of successors virtual ~ModelAPI_Data() {} @@ -54,4 +83,7 @@ protected: {} }; +typedef boost::shared_ptr DataPtr; + + #endif