]> SALOME platform Git repositories - modules/shaper.git/blob - src/CollectionPlugin/CollectionPlugin_Plugin.cpp
Salome HOME
Issue #2052: Modification of parameters don't work (sketch, extrusion)
[modules/shaper.git] / src / CollectionPlugin / CollectionPlugin_Plugin.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 #include <CollectionPlugin_Plugin.h>
4
5 #include <CollectionPlugin_Group.h>
6 #include <CollectionPlugin_Field.h>
7 #include <ModelAPI_Session.h>
8
9 #include <ModuleBase_WidgetCreatorFactory.h>
10
11 #include "CollectionPlugin_WidgetCreator.h"
12
13 #include <string>
14 #include <memory>
15
16 // the only created instance of this plugin
17 static CollectionPlugin_Plugin* MY_COLLECTION_INSTANCE = new CollectionPlugin_Plugin();
18
19 CollectionPlugin_Plugin::CollectionPlugin_Plugin()
20 {
21   WidgetCreatorFactoryPtr aWidgetCreatorFactory = ModuleBase_WidgetCreatorFactory::get();
22   aWidgetCreatorFactory->registerCreator(
23    std::shared_ptr<CollectionPlugin_WidgetCreator>(new CollectionPlugin_WidgetCreator()));
24
25   SessionPtr aMgr = ModelAPI_Session::get();
26   // register this plugin
27   ModelAPI_Session::get()->registerPlugin(this);
28 }
29
30 FeaturePtr CollectionPlugin_Plugin::createFeature(std::string theFeatureID)
31 {
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);
36   }
37
38
39   // feature of such kind is not found
40   return FeaturePtr();
41 }