1 // File: ModelAPI_Object.hxx
2 // Created: 19 May 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef ModelAPI_Object_H_
6 #define ModelAPI_Object_H_
10 #include <boost/shared_ptr.hpp>
13 class ModelAPI_Document;
15 /**\class ModelAPI_Object
17 * \brief Represents any object in the data model and in the object browser.
19 * It may be feature or result of the feature. User just may set name for it
20 * or change this name later. Generic class for Feature, Body, Parameter and other
21 * objects related to the features and their results. Contains attributes of this
22 * object in the "Data".
26 boost::shared_ptr<ModelAPI_Data> myData; ///< manager of the data model of a feature
27 boost::shared_ptr<ModelAPI_Document> myDoc; ///< document this object belongs to
29 /// By default object is displayed in the object browser.
30 virtual bool isInHistory()
35 /// Returns the data manager of this object: attributes
36 virtual boost::shared_ptr<ModelAPI_Data> data()
41 /// Returns true if object refers to the same data model instance
42 virtual bool isSame(const boost::shared_ptr<ModelAPI_Object>& theObject)
44 return theObject.get() == this;
47 /// Returns document this feature belongs to
48 virtual boost::shared_ptr<ModelAPI_Document> document()
53 /// Returns the group identifier of this object
54 virtual std::string groupName() = 0;
57 /// Sets the data manager of an object (document does)
58 virtual void setData(boost::shared_ptr<ModelAPI_Data> theData)
63 /// Sets the data manager of an object (document does)
64 virtual void setDoc(boost::shared_ptr<ModelAPI_Document> theDoc)
69 friend class Model_Document;
72 typedef boost::shared_ptr<ModelAPI_Object> ObjectPtr;