ADD_SUBDIRECTORY (src/ModelAPI)
ADD_SUBDIRECTORY (src/Config)
ADD_SUBDIRECTORY (src/PartSet)
+ADD_SUBDIRECTORY (src/PartSetPlugin)
ADD_SUBDIRECTORY (src/XGUI)
\r
#include "Config.h"\r
\r
-#include <Event_Message.hxx>\r
+#include <Event_Message.h>\r
#include <string>\r
\r
class CONFIG_EXPORT Config_FeatureMessage: public Event_Message\r
void setWorkbenchId(const std::string& workbenchId);\r
};\r
\r
-#endif // CONFIG_MESSAGE_H\r
\ No newline at end of file
+#endif // CONFIG_MESSAGE_H
\ No newline at end of file
#include <Config_FeatureReader.h>
-#include <Event_Loop.hxx>
+#include <Event_Loop.h>
#include <libxml\parser.h>
#include <libxml\tree.h>
#include <Config_XMLReader.h>
-#include <Event_Loop.hxx>
+#include <Event_Loop.h>
#include <libxml\parser.h>
#include <libxml\tree.h>
INCLUDE(Common)
SET(PROJECT_HEADERS
- Event.hxx
- Event_Message.hxx
- Event_Listener.hxx
- Event_Loop.hxx
+ Event.h
+ Event_Message.h
+ Event_Listener.h
+ Event_Loop.h
)
SET(PROJECT_SOURCES
--- /dev/null
+#ifndef EVENT_H
+#define EVENT_H
+
+#if defined EVENT_EXPORTS
+#if defined WIN32
+#define EVENT_EXPORT __declspec( dllexport )
+#else
+#define EVENT_EXPORT
+#endif
+#else
+#if defined WIN32
+#define EVENT_EXPORT __declspec( dllimport )
+#else
+#define EVENT_EXPORT
+#endif
+#endif
+
+#endif
+++ /dev/null
-#ifndef EVENT_H
-#define EVENT_H
-
-#if defined EVENT_EXPORTS
-#if defined WIN32
-#define EVENT_EXPORT __declspec( dllexport )
-#else
-#define EVENT_EXPORT
-#endif
-#else
-#if defined WIN32
-#define EVENT_EXPORT __declspec( dllimport )
-#else
-#define EVENT_EXPORT
-#endif
-#endif
-
-#endif
// Created: Thu Mar 13 2014
// Author: Mikhail PONIKAROV
-#include <Event_Listener.hxx>
+#include <Event_Listener.h>
--- /dev/null
+// File: Event_Listener.hxx
+// Created: Thu Mar 13 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Event_Listener_HeaderFile
+#define Event_Listener_HeaderFile
+
+#include <Event.h>
+class Event_Message;
+
+/**\class Event_Listener
+ * \ingroup EventLoop
+ * \brief Base interface for any event listener.
+ *
+ * If some object wants to listen some events it must inherit
+ * this class and register in the Loop.
+ */
+class EVENT_EXPORT Event_Listener {
+
+public:
+ //! This method is called by loop when the event is started to process.
+ virtual void ProcessEvent(const Event_Message* theMessage) = 0;
+};
+
+#endif
+++ /dev/null
-// File: Event_Listener.hxx
-// Created: Thu Mar 13 2014
-// Author: Mikhail PONIKAROV
-
-#ifndef Event_Listener_HeaderFile
-#define Event_Listener_HeaderFile
-
-#include <Event.hxx>
-class Event_Message;
-
-/**\class Event_Listener
- * \ingroup EventLoop
- * \brief Base interface for any event listener.
- *
- * If some object wants to listen some events it must inherit
- * this class and register in the Loop.
- */
-class EVENT_EXPORT Event_Listener
-{
-
-public:
- //! This method is called by loop when the event is started to process.
- virtual void ProcessEvent(const Event_Message* theMessage) = 0;
-};
-
-#endif
// Created: Thu Mar 13 2014
// Author: Mikhail PONIKAROV
-#include <Event_Loop.hxx>
+#include <Event_Loop.h>
#include <string>
using namespace std;
--- /dev/null
+// File: Event_Loop.hxx
+// Created: Thu Mar 13 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Event_Loop_HeaderFile
+#define Event_Loop_HeaderFile
+
+#include <Event_Message.h>
+#include <Event_Listener.h>
+
+#include <map>
+#include <list>
+
+/**\class Event_Lopp
+ * \ingroup EventLoop
+ * \brief Base class that manages the receiving and sending of all
+ * not Qt-events in the application.
+ *
+ * One per application, initialized on start. Listeners must register in this loop
+ * to get events, called by senders. Sending of events is very fast (just adding to container).
+ * Performing of events is processed in separated thread, so, sender takes
+ * control back immideately.
+ */
+class Event_Loop {
+ std::map<char*, std::map<void*, std::list<Event_Listener*> > >
+ myListeners; ///< map from event ID to sender pointer to listeners that must be called for this
+
+ //! The empty constructor, will be called at startup of the application, only once
+ Event_Loop() {};
+public:
+ ///! Returns the main object of the loop, one per application.
+ EVENT_EXPORT static Event_Loop* Loop();
+ //! Returns the unique event by the given name. Call this method only on initialization of object
+ //! to speedup the events processing without parsing of the string.
+ EVENT_EXPORT static Event_ID EventByName(const char* theName);
+
+ //! Allows to send an event
+ EVENT_EXPORT void Send(Event_Message& theMessage);
+
+ //! Registers (or adds if such listener is already registered) a listener
+ //! that will be called on the event and from the defined sender
+ EVENT_EXPORT void RegisterListener(Event_Listener* theListener, const Event_ID theID,
+ void* theSender = 0);
+};
+
+#endif
+++ /dev/null
-// File: Event_Loop.hxx
-// Created: Thu Mar 13 2014
-// Author: Mikhail PONIKAROV
-
-#ifndef Event_Loop_HeaderFile
-#define Event_Loop_HeaderFile
-
-#include <Event_Message.hxx>
-#include <Event_Listener.hxx>
-
-#include <map>
-#include <list>
-
-/**\class Event_Lopp
- * \ingroup EventLoop
- * \brief Base class that manages the receiving and sending of all
- * not Qt-events in the application.
- *
- * One per application, initialized on start. Listeners must register in this loop
- * to get events, called by senders. Sending of events is very fast (just adding to container).
- * Performing of events is processed in separated thread, so, sender takes
- * control back immideately.
- */
-class Event_Loop
-{
- std::map<char*, std::map<void*, std::list<Event_Listener*> > > myListeners; ///< map from event ID to sender pointer to listeners that must be called for this
-
- //! The empty constructor, will be called at startup of the application, only once
- Event_Loop()
- {
- }
- ;
-public:
- ///! Returns the main object of the loop, one per application.
- EVENT_EXPORT static Event_Loop* Loop();
- //! Returns the unique event by the given name. Call this method only on initialization of object
- //! to speedup the events processing without parsing of the string.
- EVENT_EXPORT static Event_ID EventByName(const char* theName);
-
- //! Allows to send an event
- EVENT_EXPORT void Send(Event_Message& theMessage);
-
- //! Registers (or adds if such listener is already registered) a listener
- //! that will be called on the event and from the defined sender
- EVENT_EXPORT void RegisterListener(Event_Listener* theListener, const Event_ID theID,
- void* theSender = 0);
-};
-
-#endif
// Created: Thu Mar 13 2014
// Author: Mikhail PONIKAROV
-#include <Event_Message.hxx>
+#include <Event_Message.h>
Event_Message::Event_Message(const Event_ID theID, const void* theSender)
: myEventId(theID), mySender((void*) theSender)
--- /dev/null
+// File: Event_Message.hxx
+// Created: Thu Mar 13 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Event_Message_HeaderFile
+#define Event_Message_HeaderFile
+
+#include <Event.h>
+
+/**\class Event_ID
+ * \ingroup EventLoop
+ * \brief Identifier of the event kind.
+ *
+ * Each event ID is created in main Envent_Loop class
+ * that stores correspondance between the string-name of the
+ * identifier and the pointer to the static string that is really
+ * used as an identifier (this is usefull for debugging of the events
+ * with log files and in debugger).
+ */
+class EVENT_EXPORT Event_ID {
+ char* myID; ///< pointer to the text-identifier of the event, unique pointer for all events of such type
+
+ Event_ID(char* theID) {myID = theID;}
+
+ friend class Event_Loop;
+public:
+ /// Returns the text-identifier of the event (for debugging reasons)
+ char* EventText() const {return myID;}
+ /// Allows to compare identifiers
+ bool operator==(const Event_ID& theID) const {return myID == theID.myID;}
+};
+
+/**\class Event_Message
+ * \ingroup EventLoop
+ * \brief Message for communication between sender and listener of event.
+ * Normally it is inherited by the higher-level
+ */
+class EVENT_EXPORT Event_Message {
+ Event_ID myEventId; ///< identifier of the event
+ void* mySender; ///< the sender object
+
+public:
+
+ //! Creates the message
+ Event_Message(const Event_ID theID, const void* theSender = 0);
+ virtual ~Event_Message() {}
+
+ //! Returns identifier of the message
+ const Event_ID& EventID() const {return myEventId;}
+
+ //! Returns sender of the message or NULL if it is anonymous message
+ void* Sender() {return mySender;}
+};
+
+#endif
+++ /dev/null
-// File: Event_Message.hxx
-// Created: Thu Mar 13 2014
-// Author: Mikhail PONIKAROV
-
-#ifndef Event_Message_HeaderFile
-#define Event_Message_HeaderFile
-
-#include <Event.hxx>
-
-/**\class Event_ID
- * \ingroup EventLoop
- * \brief Identifier of the event kind.
- *
- * Each event ID is created in main Envent_Loop class
- * that stores correspondance between the string-name of the
- * identifier and the pointer to the static string that is really
- * used as an identifier (this is usefull for debugging of the events
- * with log files and in debugger).
- */
-class EVENT_EXPORT Event_ID
-{
- char* myID; ///< pointer to the text-identifier of the event, unique pointer for all events of such type
-
- Event_ID(char* theID)
- {
- myID = theID;
- }
-
- friend class Event_Loop;
-public:
- /// Returns the text-identifier of the event (for debugging reasons)
- char* EventText() const
- {
- return myID;
- }
- /// Allows to compare identifiers
- bool operator==(const Event_ID& theID) const
- {
- return myID == theID.myID;
- }
-};
-
-/**\class Event_Message
- * \ingroup EventLoop
- * \brief Message for communication between sender and listener of event.
- * Normally it is inherited by the higher-level
- */
-class EVENT_EXPORT Event_Message
-{
- Event_ID myEventId; ///< identifier of the event
- void* mySender; ///< the sender object
-
-public:
-
- //! Creates the message
- Event_Message(const Event_ID theID, const void* theSender = 0);
- virtual ~Event_Message()
- {
- }
-
- //! Returns identifier of the message
- const Event_ID& EventID() const
- {
- return myEventId;
- }
-
- //! Returns sender of the message or NULL if it is anonymous message
- void* Sender()
- {
- return mySender;
- }
-};
-
-#endif
INCLUDE(FindBoost)
SET(PROJECT_HEADERS
- Model.hxx
- Model_Document.hxx
- Model_PluginManager.hxx
- Model_Feature.hxx
+ Model.h
+ Model_Document.h
+ Model_PluginManager.h
+ Model_Feature.h
)
SET(PROJECT_SOURCES
--- /dev/null
+#ifndef MODEL_H
+#define MODEL_H
+
+#if defined MODEL_EXPORTS
+#if defined WIN32
+#define MODEL_EXPORT __declspec( dllexport )
+#else
+#define MODEL_EXPORT
+#endif
+#else
+#if defined WIN32
+#define MODEL_EXPORT __declspec( dllimport )
+#else
+#define MODEL_EXPORT
+#endif
+#endif
+
+#endif
+++ /dev/null
-#ifndef MODEL_H
-#define MODEL_H
-
-#if defined MODEL_EXPORTS
-#if defined WIN32
-#define MODEL_EXPORT __declspec( dllexport )
-#else
-#define MODEL_EXPORT
-#endif
-#else
-#if defined WIN32
-#define MODEL_EXPORT __declspec( dllimport )
-#else
-#define MODEL_EXPORT
-#endif
-#endif
-
-#endif
--- /dev/null
+// File: Model_Application.hxx
+// Created: 28 Dec 2011
+// Author: Mikhail PONIKAROV
+// Copyright: CEA 2011
+
+#ifndef Model_Application_HeaderFile
+#define Model_Application_HeaderFile
+
+#include <Model_Document.hxx>
+#include <ModelAPI_Application.hxx>
+#include <TDocStd_Application.hxx>
+
+// Define handle class
+DEFINE_STANDARD_HANDLE(Model_Application, TDocStd_Application)
+
+/**\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 Model_Application: public TDocStd_Application, public ModelAPI_Application
+{
+public:
+ // useful methods inside of the module
+
+ // CASCADE RTTI
+ DEFINE_STANDARD_RTTI(Model_Application)
+ ;
+
+ //! Retuns the application: one per process
+ MODEL_EXPORT static Handle_Model_Application GetApplication();
+ //! Returns the main document (on first call creates it)
+ MODEL_EXPORT ModelAPI_Document* GetMainDocument();
+
+public:
+ // Redefined OCAF methods
+ //! Return name of resource (i.e. "Standard")
+ Standard_CString ResourcesName();
+ //! Return format (i.e "MDTV-Standard")
+ //! \param theFormats sequence of allowed formats for input/output
+ virtual void Formats(TColStd_SequenceOfExtendedString& theFormats);
+ //! Constructor
+ //! Use method GetInstance() method to obtain
+ //! the static instance of the object (or derive your own application)
+ Model_Application();
+
+private:
+
+ Handle_Model_Document myMainDoc; ///< main document of an application
+};
+
+#endif
+++ /dev/null
-// File: Model_Application.hxx
-// Created: 28 Dec 2011
-// Author: Mikhail PONIKAROV
-// Copyright: CEA 2011
-
-#ifndef Model_Application_HeaderFile
-#define Model_Application_HeaderFile
-
-#include <Model_Document.hxx>
-#include <ModelAPI_Application.hxx>
-#include <TDocStd_Application.hxx>
-
-// Define handle class
-DEFINE_STANDARD_HANDLE(Model_Application, TDocStd_Application)
-
-/**\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 Model_Application: public TDocStd_Application, public ModelAPI_Application
-{
-public:
- // useful methods inside of the module
-
- // CASCADE RTTI
- DEFINE_STANDARD_RTTI(Model_Application)
- ;
-
- //! Retuns the application: one per process
- MODEL_EXPORT static Handle_Model_Application GetApplication();
- //! Returns the main document (on first call creates it)
- MODEL_EXPORT ModelAPI_Document* GetMainDocument();
-
-public:
- // Redefined OCAF methods
- //! Return name of resource (i.e. "Standard")
- Standard_CString ResourcesName();
- //! Return format (i.e "MDTV-Standard")
- //! \param theFormats sequence of allowed formats for input/output
- virtual void Formats(TColStd_SequenceOfExtendedString& theFormats);
- //! Constructor
- //! Use method GetInstance() method to obtain
- //! the static instance of the object (or derive your own application)
- Model_Application();
-
-private:
-
- Handle_Model_Document myMainDoc; ///< main document of an application
-};
-
-#endif
// Author: Mikhail PONIKAROV
// Copyright: CEA 2011
-#include <Model_Document.hxx>
+#include <Model_Document.h>
#include <TDataStd_Integer.hxx>
--- /dev/null
+// File: Model_Document.hxx
+// Created: 28 Dec 2011
+// Author: Mikhail PONIKAROV
+// Copyright: CEA 2011
+
+#ifndef Model_Document_HeaderFile
+#define Model_Document_HeaderFile
+
+#include <Model.h>
+#include <ModelAPI_Document.h>
+#include <TDocStd_Document.hxx>
+
+class Handle_Model_Document;
+
+/**\class Model_Document
+ * \ingroup DataModel
+ * \brief Document for internal data structure of any object storage. Corresponds to the SALOME study.
+ * Document contains all data of te SALOME Study specific to this module
+ * that must be written into the HDF file.
+ * Also it provides acces to this data: open/save, transactions management etc.
+ * to provide access to all stored data.
+ */
+
+class Model_Document: public TDocStd_Document, public ModelAPI_Document
+{
+public:
+
+ DEFINE_STANDARD_RTTI(Model_Document)
+ ;
+
+ //! Creates new document by the format string of a storage
+ Model_Document(const TCollection_ExtendedString& theStorageFormat);
+ //! Deletes all high-level data, managed this document
+ ~Model_Document();
+
+ //! Loads the OCAF document from the file.
+ //! \param theFileName full name of the file to load
+ //! \param theStudyID identifier of the SALOME study to associate with loaded file
+ //! \returns true if file was loaded successfully
+ MODEL_EXPORT bool Load(const char* theFileName);
+
+ //! Saves the OCAF document to the file.
+ //! \param theFileName full name of the file to store
+ //! \returns true if file was stored successfully
+ MODEL_EXPORT bool Save(const char* theFileName);
+
+ //! Removes document data
+ MODEL_EXPORT void Close();
+
+ //! Starts a new operation (opens a tansaction)
+ MODEL_EXPORT void StartOperation();
+ //! Finishes the previously started operation (closes the transaction)
+ MODEL_EXPORT void FinishOperation();
+ //! Aborts the operation
+ MODEL_EXPORT void AbortOperation();
+ //! Returns true if operation has been started, but not yet finished or aborted
+ MODEL_EXPORT bool IsOperation();
+ //! Returns true if document was modified (since creation/opening)
+ MODEL_EXPORT bool IsModified();
+
+ //! Returns True if there are available Undos
+ MODEL_EXPORT bool CanUndo();
+ //! Undoes last operation
+ MODEL_EXPORT void Undo();
+ //! Returns True if there are available Redos
+ MODEL_EXPORT bool CanRedo();
+ //! Redoes last operation
+ MODEL_EXPORT void Redo();
+
+protected:
+
+private:
+ int myTransactionsAfterSave; ///< number of transactions after the last "save" call, used for "IsModified" method
+};
+
+// Define handle class
+DEFINE_STANDARD_HANDLE(Model_Document, TDocStd_Document)
+
+#endif
+++ /dev/null
-// File: Model_Document.hxx
-// Created: 28 Dec 2011
-// Author: Mikhail PONIKAROV
-// Copyright: CEA 2011
-
-#ifndef Model_Document_HeaderFile
-#define Model_Document_HeaderFile
-
-#include <Model.hxx>
-#include <ModelAPI_Document.hxx>
-#include <TDocStd_Document.hxx>
-
-class Handle_Model_Document;
-
-/**\class Model_Document
- * \ingroup DataModel
- * \brief Document for internal data structure of any object storage. Corresponds to the SALOME study.
- * Document contains all data of te SALOME Study specific to this module
- * that must be written into the HDF file.
- * Also it provides acces to this data: open/save, transactions management etc.
- * to provide access to all stored data.
- */
-
-class Model_Document: public TDocStd_Document, public ModelAPI_Document
-{
-public:
-
- DEFINE_STANDARD_RTTI(Model_Document)
- ;
-
- //! Creates new document by the format string of a storage
- Model_Document(const TCollection_ExtendedString& theStorageFormat);
- //! Deletes all high-level data, managed this document
- ~Model_Document();
-
- //! Loads the OCAF document from the file.
- //! \param theFileName full name of the file to load
- //! \param theStudyID identifier of the SALOME study to associate with loaded file
- //! \returns true if file was loaded successfully
- MODEL_EXPORT bool Load(const char* theFileName);
-
- //! Saves the OCAF document to the file.
- //! \param theFileName full name of the file to store
- //! \returns true if file was stored successfully
- MODEL_EXPORT bool Save(const char* theFileName);
-
- //! Removes document data
- MODEL_EXPORT void Close();
-
- //! Starts a new operation (opens a tansaction)
- MODEL_EXPORT void StartOperation();
- //! Finishes the previously started operation (closes the transaction)
- MODEL_EXPORT void FinishOperation();
- //! Aborts the operation
- MODEL_EXPORT void AbortOperation();
- //! Returns true if operation has been started, but not yet finished or aborted
- MODEL_EXPORT bool IsOperation();
- //! Returns true if document was modified (since creation/opening)
- MODEL_EXPORT bool IsModified();
-
- //! Returns True if there are available Undos
- MODEL_EXPORT bool CanUndo();
- //! Undoes last operation
- MODEL_EXPORT void Undo();
- //! Returns True if there are available Redos
- MODEL_EXPORT bool CanRedo();
- //! Redoes last operation
- MODEL_EXPORT void Redo();
-
-protected:
-
-private:
- int myTransactionsAfterSave; ///< number of transactions after the last "save" call, used for "IsModified" method
-};
-
-// Define handle class
-DEFINE_STANDARD_HANDLE(Model_Document, TDocStd_Document)
-
-#endif
// Created: 21 Mar 2014
// Author: Mikhail PONIKAROV
-#include <Model_Feature.hxx>
+#include <Model_Feature.h>
using namespace std;
--- /dev/null
+// File: Model_Feature.hxx
+// Created: 21 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Model_Feature_HeaderFile
+#define Model_Feature_HeaderFile
+
+#include "Model.h"
+#include <ModelAPI_Feature.h>
+
+/**\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_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
// Created: 20 Mar 2014
// Author: Mikhail PONIKAROV
-#include <Model_PluginManager.hxx>
-#include <ModelAPI_Feature.hxx>
-#include <Model_Feature.hxx>
-#include <Event_Loop.hxx>
+#include <Model_PluginManager.h>
+#include <ModelAPI_Feature.h>
+#include <Model_Feature.h>
+#include <Event_Loop.h>
#include <Config_FeatureMessage.h>
+#include <Config_ModuleReader.h>
+
+#include <OSD_SharedLibrary.hxx>
using namespace std;
+static Model_PluginManager* myImpl = new Model_PluginManager();
+
boost::shared_ptr<ModelAPI_Feature> Model_PluginManager::CreateFeature(string theFeatureID)
{
- return boost::shared_ptr<ModelAPI_Feature>(new Model_Feature());
+ if (this != myImpl) return myImpl->CreateFeature(theFeatureID);
+
+ LoadPluginsInfo();
+ if (myPlugins.find(theFeatureID) != myPlugins.end()) {
+ string aLibName = myPlugins[theFeatureID];
+#ifdef WIN32
+ aLibName += ".dll";
+#else
+ aLibName += ".so";
+#endif
+ Standard_CString aLibNameCStr = aLibName.c_str();
+ OSD_SharedLibrary aLib(aLibNameCStr);
+ if (aLib.DlOpen(OSD_RTLD_NOW)) {
+ OSD_Function aFunc = aLib.DlSymb("CreateFeature");
+ }
+ }
+
+ return boost::shared_ptr<ModelAPI_Feature>(); // return nothing
}
Model_PluginManager::Model_PluginManager()
{
+ myPluginsInfoLoaded = false;
static Event_ID aFeatureEvent = Event_Loop::EventByName("Feature");
- static Model_PluginManager* myImpl = new Model_PluginManager();
- ModelAPI_PluginManager::SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager>(myImpl));
+ ModelAPI_PluginManager::SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager>(this));
// 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);
+ const Config_FeatureMessage* aMsg =
+ dynamic_cast<const Config_FeatureMessage*>( theMessage );
if (aMsg) {
// proccess the plugin info, load plugin
+ if (myPlugins.find(aMsg->id()) == myPlugins.end()) {
+ myPlugins[aMsg->id()] = "PartSetPlugin"; // TO DO: plugin name must be also imported from XMLs
+ }
}
+ // plugins information was started to load, so, it will be loaded
+ myPluginsInfoLoaded = true;
+}
+
+void Model_PluginManager::LoadPluginsInfo()
+{
+ if (myPluginsInfoLoaded) // nothing to do
+ return;
+
+ // Read plugins information from XML files
+ Config_ModuleReader aXMLReader;
+ aXMLReader.setAutoImport(true);
+ aXMLReader.readAll();
}
--- /dev/null
+// File: Model_PluginManager.hxx
+// Created: 20 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Model_PluginManager_HeaderFile
+#define Model_PluginManager_HeaderFile
+
+#include "Model.h"
+#include <ModelAPI_PluginManager.h>
+#include <Event_Listener.h>
+#include <map>
+
+/**\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_PluginManager : public ModelAPI_PluginManager, public Event_Listener
+{
+ bool myPluginsInfoLoaded; ///< it true if plugins information is loaded
+ std::map<std::string, std::string> myPlugins; ///< map of feature IDs to plugin name
+public:
+ /// Creates the feature object using plugins functionality
+ MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> CreateFeature(std::string theFeatureID);
+
+ /// Processes the configuration file reading
+ MODEL_EXPORT virtual void ProcessEvent(const Event_Message* theMessage);
+
+ /// Is called only once, on startup of the application
+ Model_PluginManager();
+
+private:
+ /// Loads (if not done yet) the information about the features and plugins
+ void LoadPluginsInfo();
+};
+
+#endif
+++ /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
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(PROJECT_HEADERS
- ModelAPI.hxx
- ModelAPI_Interface.hxx
- ModelAPI_PluginManager.hxx
- ModelAPI_Feature.hxx
- ModelAPI_Document.hxx
+ ModelAPI.h
+ ModelAPI_Interface.h
+ ModelAPI_PluginManager.h
+ ModelAPI_Feature.h
+ ModelAPI_Document.h
)
SET(PROJECT_SOURCES
--- /dev/null
+#ifndef MODELAPI_H
+#define MODELAPI_H
+
+#if defined MODELAPI_EXPORTS
+#if defined WIN32
+#define MODELAPI_EXPORT __declspec( dllexport )
+#else
+#define MODELAPI_EXPORT
+#endif
+#else
+#if defined WIN32
+#define MODELAPI_EXPORT __declspec( dllimport )
+#else
+#define MODELAPI_EXPORT
+#endif
+#endif
+
+#endif
+++ /dev/null
-#ifndef MODELAPI_H
-#define MODELAPI_H
-
-#if defined MODELAPI_EXPORTS
-#if defined WIN32
-#define MODELAPI_EXPORT __declspec( dllexport )
-#else
-#define MODELAPI_EXPORT
-#endif
-#else
-#if defined WIN32
-#define MODELAPI_EXPORT __declspec( dllimport )
-#else
-#define MODELAPI_EXPORT
-#endif
-#endif
-
-#endif
/* ModelAPI.i */
%module ModelAPI
%{
- #include "ModelAPI.hxx"
- #include "ModelAPI_Document.hxx"
- #include "ModelAPI_PluginManager.hxx"
- #include "ModelAPI_Feature.hxx"
+ #include "ModelAPI.h"
+ #include "ModelAPI_Document.h"
+ #include "ModelAPI_PluginManager.h"
+ #include "ModelAPI_Feature.h"
%}
// to avoid error on this
%shared_ptr(ModelAPI_Feature)
// all supported interfaces
-%include "ModelAPI_Document.hxx"
-%include "ModelAPI_PluginManager.hxx"
-%include "ModelAPI_Feature.hxx"
+%include "ModelAPI_Document.h"
+%include "ModelAPI_PluginManager.h"
+%include "ModelAPI_Feature.h"
--- /dev/null
+// File: Model_Document.hxx
+// Created: 28 Dec 2011
+// Author: Mikhail PONIKAROV
+// Copyright: CEA 2011
+
+#ifndef ModelAPI_Document_HeaderFile
+#define ModelAPI_Document_HeaderFile
+
+#include <ModelAPI.h>
+
+/**\class Model_Document
+ * \ingroup DataModel
+ * \brief Document for internal data structure of any object storage. Corresponds to the SALOME study.
+ * Document contains all data of te SALOME Study specific to this module
+ * that must be written into the HDF file.
+ * Also it provides acces to this data: open/save, transactions management etc.
+ * to provide access to all stored data.
+ */
+
+class ModelAPI_Document
+{
+public:
+
+ //! Loads the OCAF document from the file.
+ //! \param theFileName full name of the file to load
+ //! \param theStudyID identifier of the SALOME study to associate with loaded file
+ //! \returns true if file was loaded successfully
+ MODELAPI_EXPORT virtual bool Load(const char* theFileName) = 0;
+
+ //! Saves the OCAF document to the file.
+ //! \param theFileName full name of the file to store
+ //! \returns true if file was stored successfully
+ MODELAPI_EXPORT virtual bool Save(const char* theFileName) = 0;
+
+ //! Removes document data
+ MODELAPI_EXPORT virtual void Close() = 0;
+
+ //! Starts a new operation (opens a tansaction)
+ MODELAPI_EXPORT virtual void StartOperation() = 0;
+ //! Finishes the previously started operation (closes the transaction)
+ MODELAPI_EXPORT virtual void FinishOperation() = 0;
+ //! Aborts the operation
+ MODELAPI_EXPORT virtual void AbortOperation() = 0;
+ //! Returns true if operation has been started, but not yet finished or aborted
+ MODELAPI_EXPORT virtual bool IsOperation() = 0;
+ //! Returns true if document was modified (since creation/opening)
+ MODELAPI_EXPORT virtual bool IsModified() = 0;
+
+ //! Returns True if there are available Undos
+ MODELAPI_EXPORT virtual bool CanUndo() = 0;
+ //! Undoes last operation
+ 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: Model_Document.hxx
-// Created: 28 Dec 2011
-// Author: Mikhail PONIKAROV
-// Copyright: CEA 2011
-
-#ifndef ModelAPI_Document_HeaderFile
-#define ModelAPI_Document_HeaderFile
-
-#include <ModelAPI.hxx>
-
-/**\class Model_Document
- * \ingroup DataModel
- * \brief Document for internal data structure of any object storage. Corresponds to the SALOME study.
- * Document contains all data of te SALOME Study specific to this module
- * that must be written into the HDF file.
- * Also it provides acces to this data: open/save, transactions management etc.
- * to provide access to all stored data.
- */
-
-class ModelAPI_Document
-{
-public:
-
- //! Loads the OCAF document from the file.
- //! \param theFileName full name of the file to load
- //! \param theStudyID identifier of the SALOME study to associate with loaded file
- //! \returns true if file was loaded successfully
- MODELAPI_EXPORT virtual bool Load(const char* theFileName) = 0;
-
- //! Saves the OCAF document to the file.
- //! \param theFileName full name of the file to store
- //! \returns true if file was stored successfully
- MODELAPI_EXPORT virtual bool Save(const char* theFileName) = 0;
-
- //! Removes document data
- MODELAPI_EXPORT virtual void Close() = 0;
-
- //! Starts a new operation (opens a tansaction)
- MODELAPI_EXPORT virtual void StartOperation() = 0;
- //! Finishes the previously started operation (closes the transaction)
- MODELAPI_EXPORT virtual void FinishOperation() = 0;
- //! Aborts the operation
- MODELAPI_EXPORT virtual void AbortOperation() = 0;
- //! Returns true if operation has been started, but not yet finished or aborted
- MODELAPI_EXPORT virtual bool IsOperation() = 0;
- //! Returns true if document was modified (since creation/opening)
- MODELAPI_EXPORT virtual bool IsModified() = 0;
-
- //! Returns True if there are available Undos
- MODELAPI_EXPORT virtual bool CanUndo() = 0;
- //! Undoes last operation
- 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.h"
+#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_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.h>
+
+/**\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_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
// Created: 20 Mar 2014
// Author: Mikhail PONIKAROV
-#include <ModelAPI_PluginManager.hxx>
+#include <ModelAPI_PluginManager.h>
// to avoid unresolved ModelAPI_Document()
-#include <ModelAPI_Document.hxx>
+#include <ModelAPI_Document.h>
// to avoid unresolved ModelAPI_Feature()
-#include <ModelAPI_Feature.hxx>
+#include <ModelAPI_Feature.h>
+
+#ifdef WIN32
+#include <windows.h>
+#else
+#include <dlfcn.h>
+#endif
+
+using namespace std;
+
+/// loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform
+void loadLibrary(const string theLibName);
+/// Converts library name to the operation system file name
+string library(const string& theLibName);
/// Manager that will be initialized from Model package, one per application
boost::shared_ptr<ModelAPI_PluginManager> MY_MANAGER;
{
}
+void ModelAPI_PluginManager::SetPluginManager(
+ boost::shared_ptr<ModelAPI_PluginManager> theManager)
+{
+ MY_MANAGER = theManager;
+}
+
boost::shared_ptr<ModelAPI_PluginManager> ModelAPI_PluginManager::Get()
{
+ if (!MY_MANAGER) { // import Model library that implements this interface of ModelAPI
+ loadLibrary("Model");
+ }
return MY_MANAGER;
}
-void ModelAPI_PluginManager::SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager> theManager)
+string library(const string& theLibName)
{
- MY_MANAGER = theManager;
+ string aLibName = theLibName;
+
+#ifndef WIN32
+ static string aLibExt( ".so" );
+ if (aLibName.size() < 3 || aLibName.substr(0, 3) !="lib")
+ aLibName = ".lib" + aLibName;
+#else
+ static string aLibExt( ".dll" );
+#endif
+
+ string anExt = aLibName.substr(aLibName.size() - 4);
+
+ if ( anExt != aLibExt)
+ aLibName += aLibExt;
+
+ return aLibName;
+}
+
+void loadLibrary(const string theLibName)
+{
+ string aFileName = library(theLibName);
+ if ( aFileName.empty() )
+ {
+ cerr<<"Library "<<theLibName.c_str()<<" can not be imported"<<endl;
+ return;
+ }
+
+#ifdef WIN32
+ HINSTANCE aModLib = ::LoadLibrary( aFileName.c_str() );
+ if (!aModLib)
+ cerr<<"Failed to load "<<aFileName.c_str()<<endl;
+#else
+ void* aModLib = dlopen( aFileName.c_str(), RTLD_LAZY );
+ if ( !aModLib )
+ cerr<<"Failed to load "<<aFileName.c_str()<<endl;
+#endif
}
--- /dev/null
+// File: ModelAPI_PluginManager.hxx
+// Created: 20 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef ModelAPI_PluginManager_HeaderFile
+#define ModelAPI_PluginManager_HeaderFile
+
+#include "ModelAPI.h"
+#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
+++ /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
#include <QString>
-#include <Event_Message.hxx>
+#include <Event_Message.h>
class PARTSET_EXPORT PartSet_Message: public Event_Message
{
#include <Config_ModuleReader.h>
#include <Config_FeatureReader.h>
-#include <Event_Loop.hxx>
+#include <Event_Loop.h>
#include <QFile>
#include <QDir>
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
+
+INCLUDE(Common)
+INCLUDE(FindBoost)
+
+SET(PROJECT_HEADERS
+ PartSetPlugin.h
+ PartSetPlugin_NewPart.h
+)
+
+SET(PROJECT_SOURCES
+ PartSetPlugin.cxx
+ PartSetPlugin_NewPart.cxx
+)
+
+ADD_DEFINITIONS(-DPARTSETPLUGIN_EXPORTS ${BOOST_DEFINITIONS})
+ADD_LIBRARY(PartSetPlugin SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+TARGET_LINK_LIBRARIES(PartSetPlugin ${PROJECT_LIBRARIES} ModelAPI)
+
+INCLUDE_DIRECTORIES(
+ ../ModelAPI
+)
+
+INSTALL(TARGETS PartSetPlugin DESTINATION plugins)
--- /dev/null
+#include "PartSetPlugin.h"
+
+#include <PartSetPlugin_NewPart.h>
+#include <boost/shared_ptr.hpp>
+
+using namespace std;
+
+/// Standard method of the plugin that creates a specific feature instance by the feature kind
+PARTSETPLUGIN_EXPORT boost::shared_ptr<ModelAPI_Feature> CreateFeature(const string& theFeatureKind)
+{
+ if (theFeatureKind == "new_part") {
+ return boost::shared_ptr<ModelAPI_Feature>(new PartSetPlugin_NewPart());
+ }
+ // feature of such kind is not found
+ return boost::shared_ptr<ModelAPI_Feature>();
+}
--- /dev/null
+#ifndef PARTSETPLUGIN_H
+#define PARTSETPLUGIN_H
+
+#if defined PARTSETPLUGIN_EXPORTS
+#if defined WIN32
+#define PARTSETPLUGIN_EXPORT __declspec( dllexport )
+#else
+#define PARTSETPLUGIN_EXPORT
+#endif
+#else
+#if defined WIN32
+#define PARTSETPLUGIN_EXPORT __declspec( dllimport )
+#else
+#define PARTSETPLUGIN_EXPORT
+#endif
+#endif
+
+#endif
--- /dev/null
+// File: PartSetPlugin_NewPart.cxx
+// Created: 27 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#include "PartSetPlugin_NewPart.hxx"
+
+PartSetPlugin_NewPart::PartSetPlugin_NewPart()
+{
+}
--- /dev/null
+// File: PartSetPlugin_NewPart.hxx
+// Created: 27 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef PartSetPlugin_NewPart_HeaderFile
+#define PartSetPlugin_NewPart_HeaderFile
+
+#include "PartSetPlugin.h"
+#include <ModelAPI_Feature.h>
+
+/**\class PartSetPlugin_NewPart
+ * \ingroup DataModel
+ * \brief Feature for creation of the new part in PartSet.
+ */
+
+class PartSetPlugin_NewPart: public ModelAPI_Feature
+{
+public:
+ /// Returns the kind of a feature
+ PARTSETPLUGIN_EXPORT virtual std::string GetKind() {return "new_part";}
+
+ /// Use plugin manager for features creation
+ PartSetPlugin_NewPart();
+};
+
+#endif
--- /dev/null
+// File: PartSetPlugin_NewPart.hxx
+// Created: 27 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef PartSetPlugin_NewPart_HeaderFile
+#define PartSetPlugin_NewPart_HeaderFile
+
+#include "PartSetPlugin.h"
+#include <ModelAPI_Feature.h>
+
+/**\class PartSetPlugin_NewPart
+ * \ingroup DataModel
+ * \brief Feature for creation of the new part in PartSet.
+ */
+
+class PartSetPlugin_NewPart: public ModelAPI_Feature
+{
+public:
+ /// Returns the kind of a feature
+ PARTSETPLUGIN_EXPORT virtual std::string GetKind() {return "new_part";}
+
+ /// Use plugin manager for features creation
+ PartSetPlugin_NewPart();
+};
+
+#endif
#include "XGUI_Viewer.h"
#include <Config_FeatureMessage.h>
-#include <Event_Loop.hxx>
+#include <Event_Loop.h>
#include <QApplication>
#include <QFileDialog>
#ifndef XGUI_WORKSHOP_H
#define XGUI_WORKSHOP_H
-#include <Event_Message.hxx>
-#include <Event_Listener.hxx>
+#include <Event_Message.h>
+#include <Event_Listener.h>
#include <QObject>
#include <QMap>