Salome HOME
Code clean up
[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_Translation.h>
11 #include <FeaturesPlugin_Partition.h>
12 #include <FeaturesPlugin_Placement.h>
13 #include <FeaturesPlugin_Revolution.h>
14 #include <FeaturesPlugin_RevolutionCut.h>
15 #include <FeaturesPlugin_RevolutionFuse.h>
16 #include <FeaturesPlugin_Rotation.h>
17
18 #include <ModelAPI_Session.h>
19
20 #include <string>
21
22 #include <memory>
23
24 using namespace std;
25
26 // the only created instance of this plugin
27 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
28
29 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
30 {
31   // register this plugin
32   ModelAPI_Session::get()->registerPlugin(this);
33 }
34
35 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
36 {
37   if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
38     return FeaturePtr(new FeaturesPlugin_Extrusion);
39   } else if (theFeatureID == FeaturesPlugin_Revolution::ID()) {
40    return FeaturePtr(new FeaturesPlugin_Revolution);
41   } else if (theFeatureID == FeaturesPlugin_Rotation::ID()) {
42     return FeaturePtr(new FeaturesPlugin_Rotation);
43   } else if (theFeatureID == FeaturesPlugin_Translation::ID()) {
44     return FeaturePtr(new FeaturesPlugin_Translation);
45   } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
46     return FeaturePtr(new FeaturesPlugin_Boolean);
47   } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
48     return FeaturePtr(new FeaturesPlugin_Group);
49   } else if (theFeatureID == FeaturesPlugin_Partition::ID()) {
50     return FeaturePtr(new FeaturesPlugin_Partition);
51   } else if (theFeatureID == FeaturesPlugin_Placement::ID()) {
52     return FeaturePtr(new FeaturesPlugin_Placement);
53   } else if (theFeatureID == FeaturesPlugin_ExtrusionCut::ID()) {
54     return FeaturePtr(new FeaturesPlugin_ExtrusionCut);
55   } else if (theFeatureID == FeaturesPlugin_ExtrusionFuse::ID()) {
56     return FeaturePtr(new FeaturesPlugin_ExtrusionFuse);
57   } else if (theFeatureID == FeaturesPlugin_RevolutionCut::ID()) {
58     return FeaturePtr(new FeaturesPlugin_RevolutionCut);
59   } else if (theFeatureID == FeaturesPlugin_RevolutionFuse::ID()) {
60     return FeaturePtr(new FeaturesPlugin_RevolutionFuse);
61   }
62   // feature of such kind is not found
63   return FeaturePtr();
64 }