Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / ModelAPI / ModelAPI_PluginManager.cpp
index a8d497c7c6986d6146148f7d525e83c54b09374d..72deaba2c695a78614a197126d513a1762cfbb12 100644 (file)
 #include <ModelAPI_Attribute.h>
 #include <ModelAPI_AttributeDocRef.h>
 #include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_AttributeReference.h>
 #include <ModelAPI_AttributeRefAttr.h>
 #include <ModelAPI_AttributeRefList.h>
+#include <ModelAPI_Events.h>
+#include <ModelAPI_Validator.h>
 
 #include <Config_ModuleReader.h>
 
@@ -40,7 +43,7 @@ ModelAPI_PluginManager::ModelAPI_PluginManager()
 {
 }
 
-void ModelAPI_PluginManager::SetPluginManager(
+void ModelAPI_PluginManager::setPluginManager(
   boost::shared_ptr<ModelAPI_PluginManager> theManager)
 {
   MY_MANAGER = theManager;
@@ -49,10 +52,22 @@ void ModelAPI_PluginManager::SetPluginManager(
 boost::shared_ptr<ModelAPI_PluginManager> ModelAPI_PluginManager::get()
 {
   if (!MY_MANAGER) { // import Model library that implements this interface of ModelAPI
-    #ifdef _DEBUG
-    std::cout << "ModelAPI_PluginManager::get: " << "Model library has not been loaded from xml." << std::endl;
-    #endif
     Config_ModuleReader::loadLibrary("Model");
   }
   return MY_MANAGER;
 }
+
+const ModelAPI_EventCreator* MY_CREATOR = 0; ///< instance of the events creator, one pre application
+
+const ModelAPI_EventCreator* ModelAPI_EventCreator::get()
+{
+  if (!MY_CREATOR) { // import Model library that implements this interface of ModelAPI
+    Config_ModuleReader::loadLibrary("Model");
+  }
+  return MY_CREATOR;
+}
+  
+void ModelAPI_EventCreator::set(const ModelAPI_EventCreator* theCreator)
+{
+  MY_CREATOR = theCreator;
+}