Salome HOME
Merge remote-tracking branch 'remotes/origin/master' into SketchSolver
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Plugin.cpp
1 #include "ConstructionPlugin_Plugin.h"
2 #include "ConstructionPlugin_Point.h"
3 #include "ConstructionPlugin_Extrusion.h"
4
5 #include <ModelAPI_PluginManager.h>
6 #include <ModelAPI_Document.h>
7
8 using namespace std;
9
10 // the only created instance of this plugin
11 static ConstructionPlugin_Plugin* MY_INSTANCE = new ConstructionPlugin_Plugin();
12
13 ConstructionPlugin_Plugin::ConstructionPlugin_Plugin() 
14 {
15   // register this plugin
16   ModelAPI_PluginManager::get()->registerPlugin(this);
17 }
18
19 FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
20 {
21   if (theFeatureID == CONSTRUCTION_POINT_KIND) {
22     return FeaturePtr(new ConstructionPlugin_Point);
23   } else if (theFeatureID == CONSTRUCTION_EXTRUSION_KIND) {
24     return FeaturePtr(new ConstructionPlugin_Extrusion);
25   }
26   // feature of such kind is not found
27   return FeaturePtr();
28 }