Salome HOME
Issue #1865 : initial implementation of fields results and high level API
[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 #include <ModelAPI_Session.h>
11
12 #include <string>
13 #include <memory>
14 #include <iostream>
15
16 // the only created instance of this plugin
17 static PrimitivesPlugin_Plugin* MY_PRIMITIVES_INSTANCE = new PrimitivesPlugin_Plugin();
18
19 PrimitivesPlugin_Plugin::PrimitivesPlugin_Plugin()
20 {
21   // register this plugin
22   ModelAPI_Session::get()->registerPlugin(this);
23 }
24
25 FeaturePtr PrimitivesPlugin_Plugin::createFeature(std::string theFeatureID)
26 {
27   if (theFeatureID == PrimitivesPlugin_Box::ID()) {
28     return FeaturePtr(new PrimitivesPlugin_Box);
29   }
30   // feature of such kind is not found
31   return FeaturePtr();
32 }