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_ExtrusionSketch.h>
8 #include <FeaturesPlugin_ExtrusionCut.h>
9 #include <FeaturesPlugin_ExtrusionFuse.h>
10 #include <FeaturesPlugin_Group.h>
11 #include <FeaturesPlugin_Translation.h>
12 #include <FeaturesPlugin_Partition.h>
13 #include <FeaturesPlugin_Placement.h>
14 #include <FeaturesPlugin_Revolution.h>
15 #include <FeaturesPlugin_RevolutionSketch.h>
16 #include <FeaturesPlugin_RevolutionCut.h>
17 #include <FeaturesPlugin_RevolutionFuse.h>
18 #include <FeaturesPlugin_Rotation.h>
19 #include <FeaturesPlugin_ValidatorTransform.h>
21 #include <ModelAPI_Session.h>
29 // the only created instance of this plugin
30 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
32 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
34 SessionPtr aMgr = ModelAPI_Session::get();
35 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
36 aFactory->registerValidator("FeaturesPlugin_ValidatorTransform",
37 new FeaturesPlugin_ValidatorTransform);
39 // register this plugin
40 ModelAPI_Session::get()->registerPlugin(this);
43 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
45 if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
46 return FeaturePtr(new FeaturesPlugin_Extrusion);
47 } else if (theFeatureID == FeaturesPlugin_Revolution::ID()) {
48 return FeaturePtr(new FeaturesPlugin_Revolution);
49 } else if (theFeatureID == FeaturesPlugin_Rotation::ID()) {
50 return FeaturePtr(new FeaturesPlugin_Rotation);
51 } else if (theFeatureID == FeaturesPlugin_Translation::ID()) {
52 return FeaturePtr(new FeaturesPlugin_Translation);
53 } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
54 return FeaturePtr(new FeaturesPlugin_Boolean);
55 } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
56 return FeaturePtr(new FeaturesPlugin_Group);
57 } else if (theFeatureID == FeaturesPlugin_Partition::ID()) {
58 return FeaturePtr(new FeaturesPlugin_Partition);
59 } else if (theFeatureID == FeaturesPlugin_Placement::ID()) {
60 return FeaturePtr(new FeaturesPlugin_Placement);
61 } else if (theFeatureID == FeaturesPlugin_ExtrusionCut::ID()) {
62 return FeaturePtr(new FeaturesPlugin_ExtrusionCut);
63 } else if (theFeatureID == FeaturesPlugin_ExtrusionFuse::ID()) {
64 return FeaturePtr(new FeaturesPlugin_ExtrusionFuse);
65 } else if (theFeatureID == FeaturesPlugin_RevolutionCut::ID()) {
66 return FeaturePtr(new FeaturesPlugin_RevolutionCut);
67 } else if (theFeatureID == FeaturesPlugin_RevolutionFuse::ID()) {
68 return FeaturePtr(new FeaturesPlugin_RevolutionFuse);
69 } else if (theFeatureID == FeaturesPlugin_ExtrusionSketch::ID()) {
70 return FeaturePtr(new FeaturesPlugin_ExtrusionSketch);
71 } else if (theFeatureID == FeaturesPlugin_RevolutionSketch::ID()) {
72 return FeaturePtr(new FeaturesPlugin_RevolutionSketch);
74 // feature of such kind is not found