#include <Model_PluginManager.h>
#include <ModelAPI_Feature.h>
#include <ModelAPI_Plugin.h>
-#include <Model_Object.h>
+#include <Model_Data.h>
#include <Model_Document.h>
#include <Model_Application.h>
#include <Event_Loop.h>
static Model_PluginManager* myImpl = new Model_PluginManager();
-std::shared_ptr<ModelAPI_Feature> Model_PluginManager::createFeature(string theFeatureID)
+shared_ptr<ModelAPI_Feature> Model_PluginManager::createFeature(string theFeatureID)
{
if (this != myImpl) return myImpl->createFeature(theFeatureID);
Model_Application::getApplication()->getDocument("root"));
}
+bool Model_PluginManager::hasRootDocument()
+{
+ return Model_Application::getApplication()->hasDocument("root");
+}
+
+shared_ptr<ModelAPI_Document> Model_PluginManager::currentDocument()
+{
+ if (!myCurrentDoc)
+ myCurrentDoc = rootDocument();
+ return myCurrentDoc;
+}
+
+void Model_PluginManager::setCurrentDocument(shared_ptr<ModelAPI_Document> theDoc)
+{
+ myCurrentDoc = theDoc;
+}
Model_PluginManager::Model_PluginManager()
{
myPluginsInfoLoaded = false;
- static Event_ID aFeatureEvent = Event_Loop::eventByName("RegisterFeature");
+ //TODO(sbh): Implement static method to extract event id [SEID]
+ static Event_ID aFeatureEvent = Event_Loop::eventByName("FeatureEvent");
ModelAPI_PluginManager::SetPluginManager(std::shared_ptr<ModelAPI_PluginManager>(this));
// register the configuration reading listener