]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp
Salome HOME
Feature #535: 5.02. Body placement by translation along a direction
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Plugin.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 #include <FeaturesPlugin_Plugin.h>
4
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>
13
14 #include <ModelAPI_Session.h>
15
16 #include <string>
17
18 #include <memory>
19
20 using namespace std;
21
22 // the only created instance of this plugin
23 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
24
25 FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
26 {
27   // register this plugin
28   ModelAPI_Session::get()->registerPlugin(this);
29 }
30
31 FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
32 {
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);
49   }
50   // feature of such kind is not found
51   return FeaturePtr();
52 }