Salome HOME
Replace boost::shared_ptr<ModelAPI_Feature> on FeaturePtr
[modules/shaper.git] / src / PartSetPlugin / PartSetPlugin_Plugin.cpp
1 #include "PartSetPlugin_Plugin.h"
2 #include "PartSetPlugin_Part.h"
3 #include "PartSetPlugin_Duplicate.h"
4 #include "PartSetPlugin_Remove.h"
5 #include <ModelAPI_PluginManager.h>
6 #include <ModelAPI_Document.h>
7
8 using namespace std;
9
10 // the only created instance of this plugin
11 static PartSetPlugin_Plugin* MY_INSTANCE = new PartSetPlugin_Plugin();
12
13 PartSetPlugin_Plugin::PartSetPlugin_Plugin() 
14 {
15   // register this plugin
16   ModelAPI_PluginManager::get()->registerPlugin(this);
17 }
18
19 FeaturePtr PartSetPlugin_Plugin::createFeature(string theFeatureID)
20 {
21   if (theFeatureID == "Part") {
22     return FeaturePtr(new PartSetPlugin_Part);
23   }
24   if (theFeatureID == "duplicate") {
25     return FeaturePtr(new PartSetPlugin_Duplicate);
26   }
27   if (theFeatureID == "remove") {
28     return FeaturePtr(new PartSetPlugin_Remove);
29   }
30     // feature of such kind is not found
31   return FeaturePtr();
32 }