1 // File: ModelAPI_Object.hxx
2 // Created: 21 Mar 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef ModelAPI_Object_HeaderFile
6 #define ModelAPI_Object_HeaderFile
12 class ModelAPI_AttributeDocRef;
13 class ModelAPI_AttributeDouble;
15 /**\class ModelAPI_Object
17 * \brief General object of the application that allows
18 * to get/set attributes from the document and compute result of an operation.
21 class MODELAPI_EXPORT ModelAPI_Object
25 /// Returns the name of the feature visible by the user in the object browser
26 virtual std::string getName() = 0;
28 /// Defines the name of the feature visible by the user in the object browser
29 virtual void setName(std::string theName) = 0;
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;
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;
43 /// Objects are created for features automatically