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_Movement.h>
10 #include <FeaturesPlugin_Placement.h>
11 #include <FeaturesPlugin_Revolution.h>
12 #include <FeaturesPlugin_Rotation.h>
14 #include <ModelAPI_Session.h>
22 // the only created instance of this plugin
23 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
25 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
27 // register this plugin
28 ModelAPI_Session::get()->registerPlugin(this);
31 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
33 if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
34 return FeaturePtr(new FeaturesPlugin_Extrusion);
35 } else if (theFeatureID == FeaturesPlugin_Revolution::ID()) {
36 return FeaturePtr(new FeaturesPlugin_Revolution);
37 } else if (theFeatureID == FeaturesPlugin_Rotation::ID()) {
38 return FeaturePtr(new FeaturesPlugin_Rotation);
39 } else if (theFeatureID == FeaturesPlugin_Movement::ID()) {
40 return FeaturePtr(new FeaturesPlugin_Movement);
41 } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
42 return FeaturePtr(new FeaturesPlugin_Boolean);
43 } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
44 return FeaturePtr(new FeaturesPlugin_Group);
45 } else if (theFeatureID == FeaturesPlugin_Placement::ID()) {
46 return FeaturePtr(new FeaturesPlugin_Placement);
47 } else if (theFeatureID == FeaturesPlugin_ExtrusionCut::ID()) {
48 return FeaturePtr(new FeaturesPlugin_ExtrusionCut);
50 // feature of such kind is not found