Salome HOME
Prepare version 1.2.1: quick fix for iteration 2 release
[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 #include <FeaturesPlugin_Revolution.h>
10
11 #include <ModelAPI_Session.h>
12
13 #include <string>
14
15 #include <memory>
16
17 using namespace std;
18
19 // the only created instance of this plugin
20 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
21
22 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
23 {
24   // register this plugin
25   ModelAPI_Session::get()->registerPlugin(this);
26 }
27
28 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
29 {
30   if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
31     return FeaturePtr(new FeaturesPlugin_Extrusion);
32   } else if (theFeatureID == FeaturesPlugin_Revolution::ID()) {
33     return FeaturePtr(new FeaturesPlugin_Revolution);
34   } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
35     return FeaturePtr(new FeaturesPlugin_Boolean);
36   } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
37     return FeaturePtr(new FeaturesPlugin_Group);
38   } else if (theFeatureID == FeaturesPlugin_Placement::ID()) {
39     return FeaturePtr(new FeaturesPlugin_Placement);
40   }
41   // feature of such kind is not found
42   return FeaturePtr();
43 }