1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 #include <CollectionPlugin_Plugin.h>
5 #include <CollectionPlugin_Group.h>
6 #include <CollectionPlugin_Field.h>
7 #include <ModelAPI_Session.h>
9 #include <ModuleBase_WidgetCreatorFactory.h>
11 #include "CollectionPlugin_WidgetCreator.h"
16 // the only created instance of this plugin
17 static CollectionPlugin_Plugin* MY_COLLECTION_INSTANCE = new CollectionPlugin_Plugin();
19 CollectionPlugin_Plugin::CollectionPlugin_Plugin()
21 WidgetCreatorFactoryPtr aWidgetCreatorFactory = ModuleBase_WidgetCreatorFactory::get();
22 aWidgetCreatorFactory->registerCreator(
23 std::shared_ptr<CollectionPlugin_WidgetCreator>(new CollectionPlugin_WidgetCreator()));
25 SessionPtr aMgr = ModelAPI_Session::get();
26 // register this plugin
27 ModelAPI_Session::get()->registerPlugin(this);
30 FeaturePtr CollectionPlugin_Plugin::createFeature(std::string theFeatureID)
32 if (theFeatureID == CollectionPlugin_Group::ID()) {
33 return FeaturePtr(new CollectionPlugin_Group);
34 }else if (theFeatureID == CollectionPlugin_Field::ID()) {
35 return FeaturePtr(new CollectionPlugin_Field);
39 // feature of such kind is not found