]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_PluginManager.cpp
Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
[modules/shaper.git] / src / ModelAPI / ModelAPI_PluginManager.cpp
1 // File:        ModelAPI_PluginManager.hxx
2 // Created:     20 Mar 2014
3 // Author:      Mikhail PONIKAROV
4
5 #include <ModelAPI_PluginManager.h>
6 // to avoid unresolved ModelAPI_Document()
7 #include <ModelAPI_Document.h>
8 // to avoid unresolved ModelAPI_Feature()
9 #include <ModelAPI_Feature.h>
10 #include <ModelAPI_Object.h>
11 // to avoid unresolved ModelAPI_Data()
12 #include <ModelAPI_Data.h>
13 // to avoid unresolved ModelAPI_Plugin()
14 #include <ModelAPI_Plugin.h>
15 #include <ModelAPI_Attribute.h>
16 #include <ModelAPI_AttributeDocRef.h>
17 #include <ModelAPI_AttributeDouble.h>
18 #include <ModelAPI_AttributeBoolean.h>
19 #include <ModelAPI_AttributeReference.h>
20 #include <ModelAPI_AttributeRefAttr.h>
21 #include <ModelAPI_AttributeRefList.h>
22
23 #include <Config_ModuleReader.h>
24
25 #ifdef WIN32
26 #include <windows.h>
27 #else
28 #include <dlfcn.h>
29 #endif
30
31 using namespace std;
32
33 #ifdef _DEBUG
34 #include <iostream>
35 #endif
36
37 /// Manager that will be initialized from Model package, one per application
38 boost::shared_ptr<ModelAPI_PluginManager> MY_MANAGER;
39
40 ModelAPI_PluginManager::ModelAPI_PluginManager()
41 {
42 }
43
44 void ModelAPI_PluginManager::SetPluginManager(
45   boost::shared_ptr<ModelAPI_PluginManager> theManager)
46 {
47   MY_MANAGER = theManager;
48 }
49
50 boost::shared_ptr<ModelAPI_PluginManager> ModelAPI_PluginManager::get()
51 {
52   if (!MY_MANAGER) { // import Model library that implements this interface of ModelAPI
53     Config_ModuleReader::loadLibrary("Model");
54   }
55   return MY_MANAGER;
56 }