]> SALOME platform Git repositories - modules/shaper.git/blob - src/Model/Model_Object.h
Salome HOME
Implemented merging groups of constraints
[modules/shaper.git] / src / Model / Model_Object.h
1 // File:        Model_Object.hxx
2 // Created:     19 May 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Model_Object_HeaderFile
6 #define Model_Object_HeaderFile
7
8 #include <Model.h>
9 #include <ModelAPI_Object.h>
10
11 #include <TDataStd_Name.hxx>
12
13 /**\class ModelAPI_Object
14  * \ingroup DataModel
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.
18  */
19 class Model_Object : public ModelAPI_Object
20 {
21   boost::shared_ptr<ModelAPI_Feature> myRef; ///< the referenced feature
22   Handle_TDataStd_Name myName; ///< the name of this object that may be changed
23 public:
24   /// Reference to the feature-operation that produces this object
25   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> featureRef();
26
27   /// Returns the name of this object (by default equal to the name of feature)
28   MODEL_EXPORT virtual std::string getName();
29
30   /// Defines the name of the object
31   MODEL_EXPORT virtual void setName(std::string theName);
32
33   /// Returns the kind of a feature (like "Point")
34   MODEL_EXPORT virtual const std::string& getKind() {return myRef->getKind();}
35
36   /// Returns to which group in the document must be added feature
37   MODEL_EXPORT virtual const std::string& getGroup() {return myRef->getGroup();}
38
39   /// It is just a reference: don't init attributes
40   MODEL_EXPORT virtual void initAttributes() {}
41
42   /// It is just a reference: don't execute
43   MODEL_EXPORT virtual void execute() {}
44
45 private:
46
47   /// Constructor fully defines this object
48   Model_Object(boost::shared_ptr<ModelAPI_Feature> theRef, Handle_TDataStd_Name theName);
49
50   friend class Model_Document;
51 };
52
53 #endif