1 #include "SketchPlugin_Plugin.h"
2 #include "SketchPlugin_Sketch.h"
3 #include "SketchPlugin_Line.h"
4 #include "SketchPlugin_ConstraintCoincidence.h"
5 #include <ModelAPI_PluginManager.h>
6 #include <ModelAPI_Document.h>
10 // the only created instance of this plugin
11 static SketchPlugin_Plugin* MY_INSTANCE = new SketchPlugin_Plugin();
13 SketchPlugin_Plugin::SketchPlugin_Plugin()
15 // register this plugin
16 ModelAPI_PluginManager::get()->registerPlugin(this);
19 boost::shared_ptr<ModelAPI_Feature> SketchPlugin_Plugin::createFeature(string theFeatureID)
21 if (theFeatureID == "Sketch") {
22 return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Sketch);
24 else if (theFeatureID == "SketchLine") {
25 return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Line);
27 else if (theFeatureID == "SketchConstraintCoincidence") {
28 return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_ConstraintCoincidence);
30 // feature of such kind is not found
31 return boost::shared_ptr<ModelAPI_Feature>();