X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Object.h;h=55ee0952733f50dbe8943d7c11f347b41e46414b;hb=7f5d3b6de3d879b6a11389c06a6f183b2fa5a1b2;hp=cf81f99bfee1dda02e24ba738a498ef8c6aeaf65;hpb=10e3997cef183d4737df5ee0ac2118cbd960b1c0;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Object.h b/src/ModelAPI/ModelAPI_Object.h index cf81f99bf..55ee09527 100644 --- a/src/ModelAPI/ModelAPI_Object.h +++ b/src/ModelAPI/ModelAPI_Object.h @@ -1,52 +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; -class ModelAPI_AttributeDouble; -class ModelAPI_Document; +#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; + /// It is never located in history + MODELAPI_EXPORT virtual bool isInHistory() {return false;} - /// Defines the name of the feature visible by the user in the object browser - virtual void setName(std::string theName) = 0; + /// Reference to the feature-operation that produces this object + MODELAPI_EXPORT virtual boost::shared_ptr featureRef() = 0; - /// Returns the attribute that references to another document - virtual std::shared_ptr docRef(const std::string theID) = 0; - /// Returns the attribute that contains real value with double precision - virtual std::shared_ptr real(const std::string theID) = 0; + /// Returns the name of this object (by default equal to the name of feature) + MODELAPI_EXPORT virtual std::string getName() = 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; + /// Defines the name of the object + MODELAPI_EXPORT virtual void setName(std::string theName) = 0; +}; - /// Returns the document of this data - virtual std::shared_ptr document() = 0; -protected: - /// Objects are created for features automatically - ModelAPI_Object() - {} -}; +typedef boost::shared_ptr ObjectPtr; #endif