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_ExtrusionCut.h>
8 #include <FeaturesPlugin_Group.h>
9 #include <FeaturesPlugin_Placement.h>
10 #include <FeaturesPlugin_Revolution.h>
11 #include <FeaturesPlugin_Rotation.h>
13 #include <ModelAPI_Session.h>
21 // the only created instance of this plugin
22 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
24 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
26 // register this plugin
27 ModelAPI_Session::get()->registerPlugin(this);
30 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
32 if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
33 return FeaturePtr(new FeaturesPlugin_Extrusion);
34 } else if (theFeatureID == FeaturesPlugin_Revolution::ID()) {
35 return FeaturePtr(new FeaturesPlugin_Revolution);
36 } else if (theFeatureID == FeaturesPlugin_Rotation::ID()) {
37 return FeaturePtr(new FeaturesPlugin_Rotation);
38 } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
39 return FeaturePtr(new FeaturesPlugin_Boolean);
40 } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
41 return FeaturePtr(new FeaturesPlugin_Group);
42 } else if (theFeatureID == FeaturesPlugin_Placement::ID()) {
43 return FeaturePtr(new FeaturesPlugin_Placement);
44 } else if (theFeatureID == FeaturesPlugin_ExtrusionCut::ID()) {
45 return FeaturePtr(new FeaturesPlugin_ExtrusionCut);
47 // feature of such kind is not found