Salome HOME
Merge branch 'BR_PYTHON_PLUGIN' of newgeom:newgeom.git into Dev_0.6.1
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Plugin.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #include "ConstructionPlugin_Plugin.h"
4 #include "ConstructionPlugin_Point.h"
5 #include "ConstructionPlugin_Axis.h"
6 #include "ConstructionPlugin_Plane.h"
7
8 #include <ModelAPI_Session.h>
9 #include <ModelAPI_Document.h>
10
11 using namespace std;
12
13 // the only created instance of this plugin
14 static ConstructionPlugin_Plugin* MY_CONSTRUCTION_INSTANCE = new ConstructionPlugin_Plugin();
15
16 ConstructionPlugin_Plugin::ConstructionPlugin_Plugin()
17 {
18   // register this plugin
19   ModelAPI_Session::get()->registerPlugin(this);
20 }
21
22 FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
23 {
24   if (theFeatureID == CONSTRUCTION_POINT_KIND) {
25     return FeaturePtr(new ConstructionPlugin_Point);
26   }
27   else if (theFeatureID == CONSTRUCTION_AXIS_KIND) {
28     return FeaturePtr(new ConstructionPlugin_Axis);
29   }
30   else if (theFeatureID == CONSTRUCTION_PLANE_KIND) {
31     return FeaturePtr(new ConstructionPlugin_Plane);
32   }
33   // feature of such kind is not found
34   return FeaturePtr();
35 }