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