Salome HOME
Add the primitive 3D "Box".
[modules/shaper.git] / src / PrimitivesPlugin / PrimitivesPlugin_Plugin.cpp
1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D -->
2
3 // File:        PrimitivesPlugin_Plugin.hxx
4 // Created:     29 Mar 2016
5 // Author:      Clarisse Genrault (CEA)
6
7 #include <PrimitivesPlugin_Plugin.h>
8
9 #include <PrimitivesPlugin_Box.h>
10
11 #include <ModelAPI_Session.h>
12
13 #include <string>
14
15 #include <memory>
16
17 #include <iostream>
18
19 using namespace std;
20
21 // the only created instance of this plugin
22 static PrimitivesPlugin_Plugin* MY_PRIMITIVES_INSTANCE = new PrimitivesPlugin_Plugin();
23
24 PrimitivesPlugin_Plugin::PrimitivesPlugin_Plugin()
25 {
26   // register this plugin
27   ModelAPI_Session::get()->registerPlugin(this);
28 }
29
30 FeaturePtr PrimitivesPlugin_Plugin::createFeature(string theFeatureID)
31 {
32   if (theFeatureID == PrimitivesPlugin_Box::ID()) {
33     return FeaturePtr(new PrimitivesPlugin_Box);
34   }
35   // feature of such kind is not found
36   return FeaturePtr();
37 }