]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSetPlugin/PartSetPlugin_Plugin.cpp
Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git] / src / PartSetPlugin / PartSetPlugin_Plugin.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #include "PartSetPlugin_Plugin.h"
4 #include "PartSetPlugin_Part.h"
5 #include "PartSetPlugin_Duplicate.h"
6 #include "PartSetPlugin_Remove.h"
7 #include <ModelAPI_Session.h>
8 #include <ModelAPI_Document.h>
9
10 using namespace std;
11
12 // the only created instance of this plugin
13 static PartSetPlugin_Plugin* MY_PARTSET_INSTANCE = new PartSetPlugin_Plugin();
14
15 PartSetPlugin_Plugin::PartSetPlugin_Plugin()
16 {
17   // register this plugin
18   ModelAPI_Session::get()->registerPlugin(this);
19 }
20
21 FeaturePtr PartSetPlugin_Plugin::createFeature(string theFeatureID)
22 {
23   if (theFeatureID == PartSetPlugin_Part::ID()) {
24     return FeaturePtr(new PartSetPlugin_Part);
25   }
26   if (theFeatureID == PartSetPlugin_Duplicate::ID()) {
27     return FeaturePtr(new PartSetPlugin_Duplicate);
28   }
29   if (theFeatureID == PartSetPlugin_Remove::ID()) {
30     return FeaturePtr(new PartSetPlugin_Remove);
31   }
32   // feature of such kind is not found
33   return FeaturePtr();
34 }