X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Object.h;h=581f045884c0e45f2bf4efc43271fbfa47634611;hb=421560a1b77974341c08898dd4eb32c283584a22;hp=490e5617ac77205b85adf6c2c4b9b370db57f3fc;hpb=1a0a0306f6d0f56c009b29cba0b53e8d1abd4edf;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Object.h b/src/ModelAPI/ModelAPI_Object.h index 490e5617a..581f04588 100644 --- a/src/ModelAPI/ModelAPI_Object.h +++ b/src/ModelAPI/ModelAPI_Object.h @@ -1,45 +1,38 @@ // File: ModelAPI_Object.hxx -// Created: 21 Mar 2014 +// Created: 19 May 2014 // Author: Mikhail PONIKAROV #ifndef ModelAPI_Object_HeaderFile #define ModelAPI_Object_HeaderFile -#include "ModelAPI.h" -#include -#include +#include "ModelAPI_Feature.h" -class ModelAPI_AttributeDocRef; +#include /**\class ModelAPI_Object * \ingroup DataModel - * \brief General object of the application that allows - * to get/set attributes from the document and compute result of an operation. + * \brief Represents the result of some feature in the object browser + * under the specific folder. Just a reference to specific feature-operation + * with possibility to rename it. */ - -class MODELAPI_EXPORT ModelAPI_Object +class ModelAPI_Object : public ModelAPI_Feature { public: - /// Returns the name of the feature visible by the user in the object browser - virtual std::string getName() = 0; - - /// Defines the name of the feature visible by the user in the object browser - virtual void setName(std::string theName) = 0; + /// It is never located in history + MODELAPI_EXPORT virtual bool isInHistory() {return false;} - /// Returns the attribute that references to another document - virtual std::shared_ptr docRef(const std::string theID) = 0; + /// Reference to the feature-operation that produces this object + MODELAPI_EXPORT virtual FeaturePtr featureRef() = 0; - /// Initializes object by the attributes: must be called just after the object is created - /// for each attribute of the object - /// \param theID identifier of the attribute that can be referenced by this ID later - /// \param theAttrType type of the created attribute (received from the type method) - virtual void addAttribute(std::string theID, std::string theAttrType) = 0; + /// Returns the name of this object (by default equal to the name of feature) + MODELAPI_EXPORT virtual std::string getName() = 0; -protected: - /// Objects are created for features automatically - ModelAPI_Object() - {} + /// Defines the name of the object + MODELAPI_EXPORT virtual void setName(std::string theName) = 0; }; + +typedef boost::shared_ptr ObjectPtr; + #endif