1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 #include <FeaturesPlugin_Plugin.h>
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>
11 #include <ModelAPI_Session.h>
19 // the only created instance of this plugin
20 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
22 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
24 // register this plugin
25 ModelAPI_Session::get()->registerPlugin(this);
28 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
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);
41 // feature of such kind is not found