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