Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / ModelAPI / ModelAPI_Feature.h
index a33d05084ea4c88675d15d9b6a653e2ebf9eecdd..fd19221b0b246c4223ec5f9eec5bac5eadb27d8c 100644 (file)
@@ -6,24 +6,29 @@
 #define ModelAPI_Feature_HeaderFile
 
 #include "ModelAPI.h"
+#include "ModelAPI_PluginManager.h"
+
 #include <string>
 #include <memory>
 
 class ModelAPI_Object;
+class ModelAPI_Document;
 
 /**\class ModelAPI_Feature
  * \ingroup DataModel
  * \brief Functionality of the model object: to update result,
  * to initialize attributes, etc.
  */
-
 class MODELAPI_EXPORT ModelAPI_Feature
 {
   std::shared_ptr<ModelAPI_Object> myData; ///< manager of the data model of a feature
 
 public:
   /// Returns the kind of a feature (like "Point")
-  virtual std::string getKind() = 0;
+  virtual const std::string& getKind() = 0;
+
+  /// Returns to which group in the document must be added feature
+  virtual const std::string& getGroup() = 0;
 
   /// Request for initialization of data model of the feature: adding all attributes
   virtual void initAttributes() = 0;
@@ -32,7 +37,12 @@ public:
   virtual void execute() = 0;
 
   /// Returns the data manager of this feature
-  std::shared_ptr<ModelAPI_Object> data() {return myData;}
+  virtual std::shared_ptr<ModelAPI_Object> data() {return myData;}
+
+  /// Must return document where the new feature must be added to
+  /// By default it is current document
+  virtual std::shared_ptr<ModelAPI_Document> documentToAdd()
+  {return ModelAPI_PluginManager::get()->currentDocument();}
 
 protected:
   /// Use plugin manager for features creation: this method is