Salome HOME
Fix of the processEvents call on Linux
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Plugin.cpp
1 #include "FeaturesPlugin_Plugin.h"
2 #include "FeaturesPlugin_Extrusion.h"
3 #include "FeaturesPlugin_Boolean.h"
4
5 #include <ModelAPI_Session.h>
6 #include <ModelAPI_Document.h>
7
8 using namespace std;
9
10 // the only created instance of this plugin
11 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
12
13 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
14 {
15   // register this plugin
16   ModelAPI_Session::get()->registerPlugin(this);
17 }
18
19 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
20 {
21   if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
22     return FeaturePtr(new FeaturesPlugin_Extrusion);
23   } else
24   if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
25     return FeaturePtr(new FeaturesPlugin_Boolean);
26   }
27   // feature of such kind is not found
28   return FeaturePtr();
29 }