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_ExtrusionFuse.h>
9 #include <FeaturesPlugin_Group.h>
10 #include <FeaturesPlugin_Movement.h>
11 #include <FeaturesPlugin_Partition.h>
12 #include <FeaturesPlugin_Placement.h>
13 #include <FeaturesPlugin_Revolution.h>
14 #include <FeaturesPlugin_RevolutionCut.h>
15 #include <FeaturesPlugin_RevolutionFuse.h>
16 #include <FeaturesPlugin_Rotation.h>
18 #include <ModelAPI_Session.h>
26 // the only created instance of this plugin
27 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
29 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
31 // register this plugin
32 ModelAPI_Session::get()->registerPlugin(this);
35 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
37 if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
38 return FeaturePtr(new FeaturesPlugin_Extrusion);
39 } else if (theFeatureID == FeaturesPlugin_Revolution::ID()) {
40 return FeaturePtr(new FeaturesPlugin_Revolution);
41 } else if (theFeatureID == FeaturesPlugin_Rotation::ID()) {
42 return FeaturePtr(new FeaturesPlugin_Rotation);
43 } else if (theFeatureID == FeaturesPlugin_Movement::ID()) {
44 return FeaturePtr(new FeaturesPlugin_Movement);
45 } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
46 return FeaturePtr(new FeaturesPlugin_Boolean);
47 } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
48 return FeaturePtr(new FeaturesPlugin_Group);
49 } else if (theFeatureID == FeaturesPlugin_Partition::ID()) {
50 return FeaturePtr(new FeaturesPlugin_Partition);
51 } else if (theFeatureID == FeaturesPlugin_Placement::ID()) {
52 return FeaturePtr(new FeaturesPlugin_Placement);
53 } else if (theFeatureID == FeaturesPlugin_ExtrusionCut::ID()) {
54 return FeaturePtr(new FeaturesPlugin_ExtrusionCut);
55 } else if (theFeatureID == FeaturesPlugin_ExtrusionFuse::ID()) {
56 return FeaturePtr(new FeaturesPlugin_ExtrusionFuse);
57 } else if (theFeatureID == FeaturesPlugin_RevolutionCut::ID()) {
58 return FeaturePtr(new FeaturesPlugin_RevolutionCut);
59 } else if (theFeatureID == FeaturesPlugin_RevolutionFuse::ID()) {
60 return FeaturePtr(new FeaturesPlugin_RevolutionFuse);
62 // feature of such kind is not found