]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp
Salome HOME
Merge remote-tracking branch 'origin/PortingSalome760' into Dev_1.3.0
[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_ExtrusionCut.h>
8 #include <FeaturesPlugin_Group.h>
9 #include <FeaturesPlugin_Placement.h>
10 #include <FeaturesPlugin_Revolution.h>
11 #include <FeaturesPlugin_Rotation.h>
12
13 #include <ModelAPI_Session.h>
14
15 #include <string>
16
17 #include <memory>
18
19 using namespace std;
20
21 // the only created instance of this plugin
22 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
23
24 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
25 {
26   // register this plugin
27   ModelAPI_Session::get()->registerPlugin(this);
28 }
29
30 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
31 {
32   if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
33     return FeaturePtr(new FeaturesPlugin_Extrusion);
34   } else if (theFeatureID == FeaturesPlugin_Revolution::ID()) {
35    return FeaturePtr(new FeaturesPlugin_Revolution);
36   } else if (theFeatureID == FeaturesPlugin_Rotation::ID()) {
37     return FeaturePtr(new FeaturesPlugin_Rotation);
38   } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
39     return FeaturePtr(new FeaturesPlugin_Boolean);
40   } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
41     return FeaturePtr(new FeaturesPlugin_Group);
42   } else if (theFeatureID == FeaturesPlugin_Placement::ID()) {
43     return FeaturePtr(new FeaturesPlugin_Placement);
44   } else if (theFeatureID == FeaturesPlugin_ExtrusionCut::ID()) {
45     return FeaturePtr(new FeaturesPlugin_ExtrusionCut);
46   }
47   // feature of such kind is not found
48   return FeaturePtr();
49 }