1 // File: Model_Object.hxx
2 // Created: 19 May 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef Model_Object_HeaderFile
6 #define Model_Object_HeaderFile
9 #include <ModelAPI_Object.h>
11 #include <TDataStd_Name.hxx>
13 /**\class ModelAPI_Object
15 * \brief Represents the result of some feature in the object browser
16 * under the specific folder. Just a reference to specific feature-operation
17 * with possibility to rename it.
19 class Model_Object : public ModelAPI_Object
21 boost::shared_ptr<ModelAPI_Feature> myRef; ///< the referenced feature
22 Handle_TDataStd_Name myName; ///< the name of this object that may be changed
24 /// Reference to the feature-operation that produces this object
25 MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> featureRef();
27 /// Returns the name of this object (by default equal to the name of feature)
28 MODEL_EXPORT virtual std::string getName();
30 /// Defines the name of the object
31 MODEL_EXPORT virtual void setName(std::string theName);
33 /// Returns the kind of a feature (like "Point")
34 MODEL_EXPORT virtual const std::string& getKind() {return myRef->getKind();}
36 /// Returns to which group in the document must be added feature
37 MODEL_EXPORT virtual const std::string& getGroup() {return myRef->getGroup();}
39 /// It is just a reference: don't init attributes
40 MODEL_EXPORT virtual void initAttributes() {}
42 /// It is just a reference: don't execute
43 MODEL_EXPORT virtual void execute() {}
47 /// Constructor fully defines this object
48 Model_Object(boost::shared_ptr<ModelAPI_Feature> theRef, Handle_TDataStd_Name theName);
50 friend class Model_Document;