Salome HOME
56f3b20e7f890f043aafb27e077d5bc4f8286744
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Plugin.cpp
1 #include "SketchPlugin_Plugin.h"
2 #include "SketchPlugin_Sketch.h"
3 #include <ModelAPI_PluginManager.h>
4 #include <ModelAPI_Document.h>
5
6 using namespace std;
7
8 // the only created instance of this plugin
9 static SketchPlugin_Plugin* MY_INSTANCE = new SketchPlugin_Plugin();
10
11 SketchPlugin_Plugin::SketchPlugin_Plugin() 
12 {
13   // register this plugin
14   ModelAPI_PluginManager::get()->registerPlugin(this);
15 }
16
17 shared_ptr<ModelAPI_Feature> SketchPlugin_Plugin::createFeature(string theFeatureID)
18 {
19   if (theFeatureID == "Sketch") {
20     return shared_ptr<ModelAPI_Feature>(new SketchPlugin_Sketch);
21   }
22   /*else if (theFeatureID == "Point") {
23     return shared_ptr<ModelAPI_Feature>(new SketchPlugin_Point);
24   }*/
25   // feature of such kind is not found
26   return shared_ptr<ModelAPI_Feature>();
27 }