Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Plugin.cpp
1 #include <FeaturesPlugin_Plugin.h>
2
3 #include <FeaturesPlugin_Boolean.h>
4 #include <FeaturesPlugin_Extrusion.h>
5 #include <FeaturesPlugin_Group.h>
6
7 #include <ModelAPI_Session.h>
8
9 #include <string>
10
11 #include <memory>
12
13 using namespace std;
14
15 // the only created instance of this plugin
16 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
17
18 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
19 {
20   // register this plugin
21   ModelAPI_Session::get()->registerPlugin(this);
22 }
23
24 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
25 {
26   if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
27     return FeaturePtr(new FeaturesPlugin_Extrusion);
28   } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
29     return FeaturePtr(new FeaturesPlugin_Boolean);
30   } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
31     return FeaturePtr(new FeaturesPlugin_Group);
32   }
33   // feature of such kind is not found
34   return FeaturePtr();
35 }