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