]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp
Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Plugin.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 #include <FeaturesPlugin_Plugin.h>
4
5 #include <FeaturesPlugin_Boolean.h>
6 #include <FeaturesPlugin_Extrusion.h>
7 #include <FeaturesPlugin_Group.h>
8 #include <FeaturesPlugin_Placement.h>
9
10 #include <ModelAPI_Session.h>
11
12 #include <string>
13
14 #include <memory>
15
16 using namespace std;
17
18 // the only created instance of this plugin
19 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
20
21 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
22 {
23   // register this plugin
24   ModelAPI_Session::get()->registerPlugin(this);
25 }
26
27 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
28 {
29   if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
30     return FeaturePtr(new FeaturesPlugin_Extrusion);
31   } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
32     return FeaturePtr(new FeaturesPlugin_Boolean);
33   } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
34     return FeaturePtr(new FeaturesPlugin_Group);
35   } else if (theFeatureID == FeaturesPlugin_Placement::ID()) {
36     return FeaturePtr(new FeaturesPlugin_Placement);
37   }
38   // feature of such kind is not found
39   return FeaturePtr();
40 }