Salome HOME
bd7465df58ac73ecb6e241eb462f02babbd69cdb
[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
7 #include <ModelAPI_Session.h>
8 #include <ModelAPI_Document.h>
9
10 using namespace std;
11
12 // the only created instance of this plugin
13 static ConstructionPlugin_Plugin* MY_CONSTRUCTION_INSTANCE = new ConstructionPlugin_Plugin();
14
15 ConstructionPlugin_Plugin::ConstructionPlugin_Plugin()
16 {
17   // register this plugin
18   ModelAPI_Session::get()->registerPlugin(this);
19 }
20
21 FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
22 {
23   if (theFeatureID == CONSTRUCTION_POINT_KIND) {
24     return FeaturePtr(new ConstructionPlugin_Point);
25   }
26   else if (theFeatureID == CONSTRUCTION_AXIS_KIND) {
27     return FeaturePtr(new ConstructionPlugin_Axis);
28   }
29   // feature of such kind is not found
30   return FeaturePtr();
31 }