Salome HOME
cd1ceb219dfc21f945721fab15a78315432c88c3
[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 #include <FeaturesPlugin_Placement.h>
7
8 #include <ModelAPI_Session.h>
9
10 #include <string>
11
12 #include <memory>
13
14 using namespace std;
15
16 // the only created instance of this plugin
17 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
18
19 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
20 {
21   // register this plugin
22   ModelAPI_Session::get()->registerPlugin(this);
23 }
24
25 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
26 {
27   if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
28     return FeaturePtr(new FeaturesPlugin_Extrusion);
29   } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
30     return FeaturePtr(new FeaturesPlugin_Boolean);
31   } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
32     return FeaturePtr(new FeaturesPlugin_Group);
33   } else if (theFeatureID == FeaturesPlugin_Placement::ID()) {
34     return FeaturePtr(new FeaturesPlugin_Placement);
35   }
36   // feature of such kind is not found
37   return FeaturePtr();
38 }