set(CMAKE_INCLUDE_CURRENT_DIR ON)
IF(WIN32)
- ADD_DEFINITIONS(-DWIN32 -D_WINDOWS)
+ ## Specific definitions: EHsc to avoid exceptions-linkage unresolved symbols
+ ADD_DEFINITIONS(-DWIN32 -D_WINDOWS /EHsc)
ENDIF(WIN32)
--- /dev/null
+# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+#find_package(Boost)
+
+SET(BOOSTDIR $ENV{BOOST_ROOT_DIR})
+INCLUDE_DIRECTORIES(${BOOSTDIR}/include/boost-1_52)
+LINK_DIRECTORIES (${BOOSTDIR}/lib)
+
+#SET(BOOST_LIBRARIES ${BOOSTDIR}/lib/lib.lib)
+
+IF(WIN32)
+ SET(BOOST_DEFINITIONS -DBOOST_DISABLE_ASSERTS -DBOOST_ALL_DYN_LINK)
+ENDIF()
INCLUDE(FindQt5)
ADD_SUBDIRECTORY (src/Event)
+ADD_SUBDIRECTORY (src/Model)
+ADD_SUBDIRECTORY (src/ModelAPI)
ADD_SUBDIRECTORY (src/Config)
-#ADD_SUBDIRECTORY (src/ModelAPI)
-#ADD_SUBDIRECTORY (src/Model)
ADD_SUBDIRECTORY (src/PartSet)
ADD_SUBDIRECTORY (src/XGUI)
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
+
+PROJECT (NewGEOM)
+
+SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH})
+
+INCLUDE(Common)
+INCLUDE(FindQt5)
+
+ADD_SUBDIRECTORY (src/Event)
+<<<<<<< Updated upstream
+ADD_SUBDIRECTORY (src/Config)
+#ADD_SUBDIRECTORY (src/ModelAPI)
+#ADD_SUBDIRECTORY (src/Model)
+ADD_SUBDIRECTORY (src/PartSet)
+=======
+ADD_SUBDIRECTORY (src/ModelAPI)
+ADD_SUBDIRECTORY (src/Model)
+>>>>>>> Stashed changes
+ADD_SUBDIRECTORY (src/XGUI)
mkdir %ROOT_DIR%\build
cd %ROOT_DIR%\build
-cmake %SRC_DIR% -G "Visual Studio 10" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
+cmake %SRC_DIR% -G "Visual Studio 10" -DWIN32 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
start "" %MSVC_EXE% NewGEOM.sln
@SET PATH=%PDIR%\swig-2.0.9\bin;%PATH%
@REM -------------------------
+@REM -------------------------
+@REM BOOST
+@SET BOOST_ROOT_DIR=%PDIR%\boost-1.52.0
+@SET PATH=%BOOST_ROOT_DIR%\lib;%PATH%
+@REM -------------------------
+
@SET PATH=D:\NewGEOM\build-eclipse\bin;%PATH%
rem -------- Visual Studio --------------------
SET(PROJECT_LIBRARIES
Event
- ${LIBXML2_LIBRARIES}
+ ${LIBXML2_LIBRARIES}
)
SOURCE_GROUP ("Resource Files" FILES ${XML_RESOURCES})
*/
void Config_XMLReader::readRecursively(xmlNodePtr theParent)
{
+ static Event_ID aFeatureEvent = Event_Loop::EventByName("Feature");
+
if(!theParent)
return;
xmlNodePtr aNode = theParent->xmlChildrenNode;
processNode(aNode);
if(processChildren(aNode)) {
readRecursively(aNode);
+ Config_FeatureMessage aMessage(aFeatureEvent, this);
}
}
}
--- /dev/null
+/*
+ * Config_XMLReader.cpp
+ *
+ * Created on: Mar 14, 2014
+ * Author: sbh
+ */
+
+#include <Config_XMLReader.h>
+
+#include <Event_Loop.hxx>
+#include <libxml\parser.h>
+#include <libxml\tree.h>
+
+#ifdef WIN32
+//For GetModuleFileNameW
+#include <windows.h>
+#endif
+
+#ifdef _DEBUG
+#include <iostream>
+#endif
+
+
+Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName)
+{
+ std::string prefix;
+ //Get path to *.xml files (typically ./bin/../plugins/)
+#ifdef WIN32
+ HMODULE hModule = GetModuleHandleW(NULL);
+ WCHAR wchar_path[MAX_PATH];
+ GetModuleFileNameW(hModule, wchar_path, MAX_PATH);
+ char char_path[MAX_PATH];
+ char DefChar = ' ';
+ WideCharToMultiByte(CP_ACP, 0, wchar_path, -1, char_path, MAX_PATH, &DefChar, NULL);
+ prefix = std::string(char_path);
+ //chop "bin\XGUI.exe"
+ unsigned found = prefix.rfind("bin");
+ if(found != std::string::npos)
+ prefix.replace(found, prefix.length(), "plugins\\");
+#else
+ //TODO(sbh): Find full path to binary on linux
+ prefix = "../plugins/";
+#endif
+
+ m_DocumentPath = prefix + theXmlFileName;
+}
+
+
+Config_XMLReader::~Config_XMLReader()
+{
+}
+
+/*
+ * Read all nodes (recursively if processChildren() is true
+ * for a node). For each read node the processNode will be
+ * called.
+ */
+void Config_XMLReader::readAll()
+{
+ xmlNodePtr aRoot = findRoot();
+ readRecursively(aRoot);
+}
+
+/*
+ * Allows to customize reader's behavior for a node. Virtual.
+ * The default implementation does nothing. (In debug mode prints
+ * some info)
+ */
+void Config_XMLReader::processNode(xmlNodePtr aNode)
+{
+ #ifdef _DEBUG
+ std::cout << "Config_XMLReader::processNode: "
+ << aNode->name << " content: "
+ << aNode->content << std::endl;
+ #endif
+}
+
+/*
+ * Defines which nodes should be processed recursively. Virtual.
+ * The default implementation to read all nodes.
+ */
+bool Config_XMLReader::processChildren(xmlNodePtr aNode)
+{
+ return true;
+}
+
+xmlNodePtr Config_XMLReader::findRoot()
+{
+ xmlDocPtr aDoc;
+ aDoc = xmlParseFile(m_DocumentPath.c_str());
+ if(aDoc == NULL) {
+ #ifdef _DEBUG
+ std::cout << "Config_XMLReader::import: " << "Document " << m_DocumentPath
+ << " is not parsed successfully." << std::endl;
+ #endif
+ return NULL;
+ }
+ xmlNodePtr aRoot = xmlDocGetRootElement(aDoc);
+ #ifdef _DEBUG
+ if(aRoot == NULL) {
+ std::cout << "Config_XMLReader::import: " << "Error: empty document";
+ }
+ #endif
+ return aRoot;
+}
+
+/*
+ * Calls processNode() for each child (for some - recursively)
+ * of the given node.
+ * \sa ReadAll()
+ */
+void Config_XMLReader::readRecursively(xmlNodePtr theParent)
+{
+<<<<<<< Updated upstream
+ if(!theParent)
+ return;
+ xmlNodePtr aNode = theParent->xmlChildrenNode;
+ for(; aNode; aNode = aNode->next) {
+ processNode(aNode);
+ if(processChildren(aNode)) {
+ readRecursively(aNode);
+=======
+ static Event_ID aFeatureEvent = Event_Loop::EventByName("Feature");
+
+ xmlNodePtr aGroupNode = (static_cast<xmlNodePtr>(theRoot))->xmlChildrenNode;
+ Event_Loop* aEvLoop = Event_Loop::Loop();
+ if(!aEvLoop) {
+ #ifdef _DEBUG
+ std::cout << "Config_XMLReader::importWorkbench: "
+ << "No event loop registered" << std::endl;
+ #endif
+ return false;
+ }
+ for(; aGroupNode; aGroupNode = aGroupNode->next) { // searching for record
+ if(!IsNode(aGroupNode, "group"))
+ continue;
+ std::string aGroupName = getProperty(aGroupNode, FEATURE_GROUP_NAME);
+ if(aGroupName.empty())
+ continue;
+ xmlNodePtr aFtNode = aGroupNode->xmlChildrenNode;
+ for(; aFtNode; aFtNode = aFtNode->next) {
+ if(!IsNode(aFtNode, "feature"))
+ continue;
+ //Create feature...
+ Config_FeatureMessage aMessage(aFeatureEvent, this);
+ fillFeature(aFtNode, aMessage);
+ aMessage.m_group = aGroupName;
+ aEvLoop->Send(aMessage);
+>>>>>>> Stashed changes
+ }
+ }
+}
+
+/*
+ * void* -> xmlNodePtr
+ */
+xmlNodePtr Config_XMLReader::node(void* theNode)
+{
+ return static_cast<xmlNodePtr>(theNode);
+}
+
+/*
+ * Returns named property for a given node as std::string.
+ */
+std::string Config_XMLReader::getProperty(xmlNodePtr theNode, const char* name)
+{
+ std::string result = "";
+ char* aPropChars = (char*) xmlGetProp(theNode, BAD_CAST name);
+ if(!aPropChars || aPropChars[0] == 0)
+ return result;
+ result = std::string(aPropChars);
+ return result;
+}
+
+/*
+ * Returns true if theNode is XML node with a given name.
+ */
+bool Config_XMLReader::isNode(xmlNodePtr theNode, const char* theNodeName, ...)
+{
+ bool result = false;
+ const xmlChar* aName = theNode->name;
+ if(!aName || theNode->type != XML_ELEMENT_NODE)
+ return false;
+
+ if(!xmlStrcmp(aName, (const xmlChar *) theNodeName))
+ return true;
+
+ va_list args; // define argument list variable
+ va_start (args, theNodeName); // init list; point to last defined argument
+ while(true) {
+ char *anArg = va_arg (args, char *); // get next argument
+ if(anArg == NULL)
+ break;
+ if(!xmlStrcmp(aName, (const xmlChar *) anArg)) {
+ va_end (args); // cleanup the system stack
+ return true;
+ }
+ }
+ va_end (args); // cleanup the system stack
+ return false;
+}
INCLUDE(Common)
INCLUDE(FindCAS)
+INCLUDE(FindBoost)
SET(PROJECT_HEADERS
Model.hxx
- Model_Application.hxx
Model_Document.hxx
+ Model_PluginManager.hxx
+ Model_Feature.hxx
)
SET(PROJECT_SOURCES
- Model_Application.cxx
Model_Document.cxx
+ Model_PluginManager.cxx
+ Model_Feature.cxx
)
-ADD_DEFINITIONS(-DMODEL_EXPORTS ${CAS_DEFINITIONS})
+ADD_DEFINITIONS(-DMODEL_EXPORTS ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS})
ADD_LIBRARY(Model SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
-TARGET_LINK_LIBRARIES(Model ${PROJECT_LIBRARIES} ${CAS_OCAF})
+TARGET_LINK_LIBRARIES(Model ${PROJECT_LIBRARIES} ${CAS_OCAF} ModelAPI Event Config)
INCLUDE_DIRECTORIES(
../ModelAPI
+ ../Event
+ ../Config
${CAS_INCLUDE_DIRS}
)
// Copyright: CEA 2011
#include <Model_Document.hxx>
-#include <Model_Application.hxx>
#include <TDataStd_Integer.hxx>
bool Model_Document::Load(const char* theFileName)
{
bool myIsError = Standard_False;
+ /*
TCollection_ExtendedString aPath ((const Standard_CString)theFileName);
PCDM_ReaderStatus aStatus = (PCDM_ReaderStatus) -1;
try
}
}
SetUndoLimit(UNDO_LIMIT);
+ */
return !myIsError;
}
bool Model_Document::Save(const char* theFileName)
{
+ bool myIsError = true;
+ /*
TCollection_ExtendedString aPath ((const Standard_CString)theFileName);
PCDM_StoreStatus aStatus;
try {
cout<<"OCAFApp_Engine:save Error: "<<aFail->GetMessageString()<<endl;
return false;
}
- bool myIsError = aStatus != PCDM_SS_OK;
+ myIsError = aStatus != PCDM_SS_OK;
if (myIsError)
{
switch (aStatus)
}
myTransactionsAfterSave = 0;
Standard::Purge(); // Release free memory
+ */
return !myIsError;
}
--- /dev/null
+// File: Model_Feature.hxx
+// Created: 21 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#include <Model_Feature.hxx>
+
+using namespace std;
+
+Model_Feature::Model_Feature()
+{
+}
+
+string Model_Feature::GetKind()
+{
+ return "Point";
+}
--- /dev/null
+// File: Model_Feature.hxx
+// Created: 21 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Model_Feature_HeaderFile
+#define Model_Feature_HeaderFile
+
+#include "Model.hxx"
+#include <ModelAPI_Feature.hxx>
+
+/**\class Model_Feature
+ * \ingroup DataModel
+ * \brief General object of the application that allows
+ * to get/set attributes from the document and compute result of an operation.
+ */
+
+class Model_Feature: public ModelAPI_Feature
+{
+ Model_Feature();
+
+ friend class Model_PluginManager;
+public:
+ /// Returns the kind of a feature (like "Point")
+ virtual std::string GetKind();
+};
+
+#endif
--- /dev/null
+// File: Model_PluginManager.cxx
+// Created: 20 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#include <Model_PluginManager.hxx>
+#include <ModelAPI_Feature.hxx>
+#include <Model_Feature.hxx>
+#include <Event_Loop.hxx>
+#include <Config_Message.h>
+
+using namespace std;
+
+boost::shared_ptr<ModelAPI_Feature> Model_PluginManager::CreateFeature(string theFeatureID)
+{
+ return boost::shared_ptr<ModelAPI_Feature>(new Model_Feature());
+}
+
+Model_PluginManager::Model_PluginManager()
+{
+ static Event_ID aFeatureEvent = Event_Loop::EventByName("Feature");
+
+ static Model_PluginManager* myImpl = new Model_PluginManager();
+ ModelAPI_PluginManager::SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager>(myImpl));
+ // register the configuration reading listener
+ Event_Loop* aLoop = Event_Loop::Loop();
+ aLoop->RegisterListener(myImpl, aFeatureEvent);
+}
+
+void Model_PluginManager::ProcessEvent(const Event_Message* theMessage)
+{
+ const Config_FeatureMessage* aMsg =
+ dynamic_cast<const Config_FeatureMessage*>( theMessage );
+ if(aMsg) {
+ // proccess the plugin info, load plugin
+ }
+}
--- /dev/null
+// File: Model_PluginManager.hxx
+// Created: 20 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Model_PluginManager_HeaderFile
+#define Model_PluginManager_HeaderFile
+
+#include "Model.hxx"
+#include <ModelAPI_PluginManager.hxx>
+#include <Event_Listener.hxx>
+
+/**\class Model_PluginManager
+ * \ingroup DataModel
+ * \brief Object that knows (from the initial XML file) which
+ * plugin contains which feature, loads and stores reference to loaded plugins by
+ * the feature functionality request.
+ */
+
+class MODEL_EXPORT Model_PluginManager : public ModelAPI_PluginManager, public Event_Listener
+{
+public:
+ /// Creates the feature object using plugins functionality
+ virtual boost::shared_ptr<ModelAPI_Feature> CreateFeature(std::string theFeatureID);
+
+ /// Processes the configuration file reading
+ virtual void ProcessEvent(const Event_Message* theMessage);
+
+private:
+ /// Is called only once, on startup of the application
+ Model_PluginManager();
+};
+
+#endif
FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})
INCLUDE(FindPython)
+INCLUDE(FindBoost)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(PROJECT_HEADERS
ModelAPI.hxx
- ModelAPI_Application.hxx
+ ModelAPI_Interface.hxx
+ ModelAPI_PluginManager.hxx
+ ModelAPI_Feature.hxx
ModelAPI_Document.hxx
)
+SET(PROJECT_SOURCES
+ ModelAPI_PluginManager.cxx
+)
+
ADD_DEFINITIONS(-DMODELAPI_EXPORTS)
ADD_LIBRARY(ModelAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
SET_TARGET_PROPERTIES(ModelAPI PROPERTIES LINKER_LANGUAGE CXX)
SET(CMAKE_SWIG_FLAGS "")
SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_FLAGS "-includeall")
+# "-includeall" is not needed: it starts to follow the standard inludes (like "string") without success
+# SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_FLAGS)
SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-#SET_SOURCE_FILES_PROPERTIES(ModelAPIPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
+#SET_SOURCE_FILES_PROPERTIES(ModelAPIPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "-D_WIN32")
SET(SWIG_SCRIPTS
${CMAKE_CURRENT_BINARY_DIR}/ModelAPI.py
%module ModelAPI
%{
#include "ModelAPI.hxx"
- #include "ModelAPI_Application.hxx"
#include "ModelAPI_Document.hxx"
+ #include "ModelAPI_PluginManager.hxx"
+ #include "ModelAPI_Feature.hxx"
%}
-%include "ModelAPI_Application.hxx"
+
+// to avoid error on this
+#define MODELAPI_EXPORT
+
+// standard definitions
+%include "typemaps.i"
+%include "std_string.i"
+
+// boost pointers
+%include <boost_shared_ptr.i>
+%shared_ptr(ModelAPI_PluginManager)
+%shared_ptr(ModelAPI_Feature)
+
+// all supported interfaces
%include "ModelAPI_Document.hxx"
+%include "ModelAPI_PluginManager.hxx"
+%include "ModelAPI_Feature.hxx"
+++ /dev/null
-// File: Model_Application.hxx
-// Created: 28 Dec 2011
-// Author: Mikhail PONIKAROV
-// Copyright: CEA 2011
-
-#ifndef ModelAPI_Application_HeaderFile
-#define ModelAPI_Application_HeaderFile
-
-#include "ModelAPI.hxx"
-class ModelAPI_Document;
-
-/**\class Model_Application
- * \ingroup DataModel
- * \brief Realization of Open CASCADE application abstraction. Class for internal use only.
- * Application supports the formats and document management. It is uses OCAF-lke
- * architecture and just implements specific features of the module.
- */
-class ModelAPI_Application
-{
-public: // useful methods inside of the module
- //! Retuns the application: one per process
- MODELAPI_EXPORT virtual ModelAPI_Application GetApplication() = 0;
-
- MODELAPI_EXPORT virtual ModelAPI_Document* GetMainDocument() = 0;
-};
-
-#endif
//! Returns True if there are available Undos
MODELAPI_EXPORT virtual bool CanUndo() = 0;
//! Undoes last operation
- MODELAPI_EXPORT virtual void Undo();
+ MODELAPI_EXPORT virtual void Undo() = 0;
//! Returns True if there are available Redos
MODELAPI_EXPORT virtual bool CanRedo() = 0;
//! Redoes last operation
MODELAPI_EXPORT virtual void Redo() = 0;
+
+ /// Only for SWIG wrapping it is here
+ MODELAPI_EXPORT ModelAPI_Document() {};
};
#endif
--- /dev/null
+// File: ModelAPI_Feature.hxx
+// Created: 21 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef ModelAPI_Feature_HeaderFile
+#define ModelAPI_Feature_HeaderFile
+
+#include "ModelAPI.hxx"
+#include <string>
+
+class ModelAPI_Feature;
+
+/**\class ModelAPI_Feature
+ * \ingroup DataModel
+ * \brief General object of the application that allows
+ * to get/set attributes from the document and compute result of an operation.
+ */
+
+class MODELAPI_EXPORT ModelAPI_Feature
+{
+public:
+ /// Returns the kind of a feature (like "Point")
+ virtual std::string GetKind() = 0;
+
+ /// Use plugin manager for features creation: this method is
+ /// defined here only for SWIG-wrapping
+ ModelAPI_Feature() {}
+};
+
+#endif
--- /dev/null
+// File: ModelAPI_Interface.hxx
+// Created: 20 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef ModelAPI_Interface_HeaderFile
+#define ModelAPI_Interface_HeaderFile
+
+#include <ModelAPI.hxx>
+
+/**\class ModelAPI_Interface
+ * \ingroup DataModel
+ * \brief General base class for all interfaces in this package
+ */
+
+class MODELAPI_EXPORT ModelAPI_Interface
+{
+ void* myImpl; ///< pointer to the internal implementation object
+
+public:
+ /// None - constructor
+ virtual ModelAPI_Interface() {myImpl = 0;}
+
+ /// Constructor by the implementation pointer (used for internal needs)
+ virtual ModelAPI_Interface(void* theImpl) {myImpl = theImpl;}
+
+ /// Copy-constructor
+ virtual ModelAPI_Interface(ModelAPI_Interface& theOrig)
+ {myImpl = theOrig.theImpl; Duplicate();}
+
+ virtual ModelAPI_Interface& operator=(ModelAPI_Interface& const theOrig)
+ {myImpl = theOrig.theImpl; Duplicate(); return *this;}
+
+ /// Duplicates the objet pointed by myImpl (loosing the old one)
+ virtual void Duplicate() = 0;
+
+};
+
+#endif
--- /dev/null
+// File: ModelAPI_PluginManager.hxx
+// Created: 20 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#include <ModelAPI_PluginManager.hxx>
+// to avoid unresolved ModelAPI_Document()
+#include <ModelAPI_Document.hxx>
+// to avoid unresolved ModelAPI_Feature()
+#include <ModelAPI_Feature.hxx>
+
+/// Manager that will be initialized from Model package, one per application
+boost::shared_ptr<ModelAPI_PluginManager> MY_MANAGER;
+
+ModelAPI_PluginManager::ModelAPI_PluginManager()
+{}
+
+boost::shared_ptr<ModelAPI_PluginManager> ModelAPI_PluginManager::Get()
+{
+ return MY_MANAGER;
+}
+
+void ModelAPI_PluginManager::SetPluginManager(
+ boost::shared_ptr<ModelAPI_PluginManager> theManager)
+{
+ MY_MANAGER = theManager;
+}
--- /dev/null
+// File: ModelAPI_PluginManager.hxx
+// Created: 20 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef ModelAPI_PluginManager_HeaderFile
+#define ModelAPI_PluginManager_HeaderFile
+
+#include "ModelAPI.hxx"
+#include <string>
+#include <boost/shared_ptr.hpp>
+
+class ModelAPI_Feature;
+
+/**\class ModelAPI_PluginManager
+ * \ingroup DataModel
+ * \brief Object that knows (from the initial XML file) which
+ * plugin contains which feature, loads and stores reference to loaded plugins by
+ * the feature functionality request.
+ */
+
+class MODELAPI_EXPORT ModelAPI_PluginManager
+{
+public:
+ /// Creates the feature object using plugins functionality
+ virtual boost::shared_ptr<ModelAPI_Feature> CreateFeature(std::string theFeatureID) = 0;
+
+ /// Returns the real implementation (the alone instance per application) of the plugin manager
+ static boost::shared_ptr<ModelAPI_PluginManager> Get();
+
+ /// Is needed for python wrapping by swig, call Get to get an instance
+ ModelAPI_PluginManager();
+
+protected:
+ static void SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager> theManager);
+};
+
+#endif