1 #include "PartSetPlugin_Plugin.h"
2 #include "PartSetPlugin_NewPart.h"
3 #include <ModelAPI_PluginManager.h>
4 #include <ModelAPI_Document.h>
8 // group identification of the newly created parts in the Part Set document
9 const int MY_PARTS_GROUP = 1;
11 // the only created instance of this plugin
12 static PartSetPlugin_Plugin* MY_INSTANCE = new PartSetPlugin_Plugin();
14 PartSetPlugin_Plugin::PartSetPlugin_Plugin()
16 // register this plugin
17 ModelAPI_PluginManager::get()->registerPlugin(this);
20 std::shared_ptr<ModelAPI_Feature> PartSetPlugin_Plugin::createFeature(string theFeatureID)
22 std::shared_ptr<ModelAPI_Feature> aCreated;
23 if (theFeatureID == "new_part") {
24 aCreated = std::shared_ptr<ModelAPI_Feature>(new PartSetPlugin_NewPart());
26 // add to a root document for the current moment
28 ModelAPI_PluginManager::get()->rootDocument()->AddObject(aCreated, MY_PARTS_GROUP);
29 // feature of such kind is not found