]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_Object.h
Salome HOME
Implementation of Point feature (without computation of result yet) plus some debug...
[modules/shaper.git] / src / ModelAPI / ModelAPI_Object.h
1 // File:        ModelAPI_Object.hxx
2 // Created:     21 Mar 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef ModelAPI_Object_HeaderFile
6 #define ModelAPI_Object_HeaderFile
7
8 #include "ModelAPI.h"
9 #include <string>
10 #include <memory>
11
12 class ModelAPI_AttributeDocRef;
13 class ModelAPI_AttributeDouble;
14
15 /**\class ModelAPI_Object
16  * \ingroup DataModel
17  * \brief General object of the application that allows
18  * to get/set attributes from the document and compute result of an operation.
19  */
20
21 class MODELAPI_EXPORT ModelAPI_Object
22 {
23 public:
24
25   /// Returns the name of the feature visible by the user in the object browser
26   virtual std::string getName() = 0;
27
28   /// Defines the name of the feature visible by the user in the object browser
29   virtual void setName(std::string theName) = 0;
30
31   /// Returns the attribute that references to another document
32   virtual std::shared_ptr<ModelAPI_AttributeDocRef> docRef(const std::string theID) = 0;
33   /// Returns the attribute that contains real value with double precision
34   virtual std::shared_ptr<ModelAPI_AttributeDouble> real(const std::string theID) = 0;
35
36   /// Initializes object by the attributes: must be called just after the object is created
37   /// for each attribute of the object
38   /// \param theID identifier of the attribute that can be referenced by this ID later
39   /// \param theAttrType type of the created attribute (received from the type method)
40   virtual void addAttribute(std::string theID, std::string theAttrType) = 0;
41
42 protected:
43   /// Objects are created for features automatically
44   ModelAPI_Object()
45   {}
46 };
47
48 #endif