+SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL directory")
SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI directory")
IF(EXISTS ${GUI_ROOT_DIR})
SET(HAVE_SALOME YES)
+ FIND_LIBRARY(caf caf ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(CAM CAM ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(CASCatch CASCatch ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(DDS DDS ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(Event Event ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(GLViewer GLViewer ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(LightApp LightApp ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(LogWindow LogWindow ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(ObjBrowser ObjBrowser ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(OCCViewer OCCViewer ${GUI_ROOT_DIR}/lib/salome)
-
+ FIND_LIBRARY(OpenGLUtils OpenGLUtils ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(Plot2d Plot2d ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(PyConsole PyConsole ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(PyInterp PyInterp ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(QDS QDS ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(qtx qtx ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(QxScene QxScene ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomeApp SalomeApp ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomeIDLGUI SalomeIDLGUI ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomeObject SalomeObject ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomePrs SalomePrs ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomePyQtGUILight SalomePyQtGUILight ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomePyQtGUI SalomePyQtGUI ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomePyQt SalomePyQt ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomePy SalomePy ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomeSession SalomeSession ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomeStyle SalomeStyle ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SOCC SOCC ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SPlot2d SPlot2d ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(std std ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SUITApp SUITApp ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(suit suit ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SVTK SVTK ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(ToolsGUI ToolsGUI ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(ViewerTools ViewerTools ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(ViewerData ViewerData ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(VTKViewer VTKViewer ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(vtkEDFOverloads vtkEDFOverloads ${GUI_ROOT_DIR}/lib/paraview)
+ FIND_LIBRARY(vtkTools vtkTools ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomeGuiHelpers SalomeGuiHelpers ${GUI_ROOT_DIR}/lib/salome)
+ FIND_LIBRARY(SalomeTreeData SalomeTreeData ${GUI_ROOT_DIR}/lib/salome)
+
SET(SALOME_GUI_INCLUDE ${GUI_ROOT_DIR}/include/salome)
+ SET(SALOME_KERNEL_INCLUDE ${KERNEL_ROOT_DIR}/include/salome)
ADD_DEFINITIONS( -DHAVE_SALOME )
ENDIF(EXISTS ${GUI_ROOT_DIR})
ADD_SUBDIRECTORY (src/Config)
-ADD_SUBDIRECTORY (src/Event)
+ADD_SUBDIRECTORY (src/Events)
ADD_SUBDIRECTORY (src/Model)
ADD_SUBDIRECTORY (src/ModelAPI)
ADD_SUBDIRECTORY (src/GeomAPI)
ADD_SUBDIRECTORY (src/XGUI)
ADD_SUBDIRECTORY (src/GeomApp)
-#IF(${HAVE_SALOME})
-# ADD_SUBDIRECTORY (src/SalomeModule)
-#ENDIF(${HAVE_SALOME})
+IF(${HAVE_SALOME})
+ ADD_SUBDIRECTORY (src/NewGeom)
+ENDIF(${HAVE_SALOME})
@SET PATH=%PDIR%\ftgl-2.1.3\bin;%PATH%
@SET PATH=%PDIR%\freetype-2.4.11\bin;%PATH%
@SET PATH=%PDIR%\gl2ps-1.3.8\bin;%PATH%
+@SET PATH=%PDIR%\qwt-5.2.1\lib;%PATH%
@REM -------------------------
IF "%ARCH%" == "Win64" (
)
@SET NEW_GEOM_CONFIG_FILE=%ROOT_DIR%\install\plugins
-@SET PATH=%ROOT_DIR%\install\plugins;%PATH%
+@SET PATH=%ROOT_DIR%\install\bin;%ROOT_DIR%\install\plugins;%PATH%
+
+@SET LightAppConfig=%ROOT_DIR%\install\share\salome\resources\newgeom;%GUI_ROOT_DIR%\share\salome\resources\gui
--- /dev/null
+@ECHO OFF
+
+REM Find absolute path to ROOT_DIR
+@SET PARENT_DIR=%~dp0..
+@SET ROOT_DIR=
+pushd %PARENT_DIR%
+@SET ROOT_DIR=%CD%
+popd
+
+@SET SRC_DIR=%ROOT_DIR%\sources
+@SET OCC_LIB_PREFIX=d
+
+call %SRC_DIR%\msvc9_env_Salome.bat
+
+
+SuitApp.exe LightApp -style salome --modules=NewGeom --uselicense --noexcepthandling
INCLUDE(Common)
INCLUDE(XMLProcessing)
-INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Event)
+INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Events)
SET(PROJECT_HEADERS
Config.h
)
SET(PROJECT_LIBRARIES
- Event
+ Events
${LIBXML2_LIBRARIES}
)
*/
#include "Config_FeatureMessage.h"
-Config_FeatureMessage::Config_FeatureMessage(const Event_ID theId, const void* theParent)
- : Event_Message(theId, theParent)
+Config_FeatureMessage::Config_FeatureMessage(const Events_ID theId, const void* theParent)
+ : Events_Message(theId, theParent)
{
myId = "";
myText = "";
#define CONFIG_MESSAGE_H\r
\r
#include <Config.h>\r
-#include <Event_Message.h>\r
+#include <Events_Message.h>\r
\r
#include <string>\r
\r
* Example of the feature entry:\r
* <feature id="Part" text="New part" tooltip="Creates a new part" icon=":pictures/part_ico.png"/>\r
*/\r
-class Config_FeatureMessage: public Event_Message\r
+class Config_FeatureMessage: public Events_Message\r
{\r
std::string myId; //Feature unique id\r
std::string myText; //Represents action's text\r
bool myUseInput; //Action is being checked until user commit the operation\r
\r
public:\r
- //const Event_ID theID, const void* theSender = 0\r
- CONFIG_EXPORT Config_FeatureMessage(const Event_ID theId, const void* theParent = 0);\r
+ //const Events_ID theID, const void* theSender = 0\r
+ CONFIG_EXPORT Config_FeatureMessage(const Events_ID theId, const void* theParent = 0);\r
\r
//TODO(sbh): Implement static method to extract event id [SEID]\r
//static const char* eventId() { return ""; }\r
CONFIG_EXPORT void setUseInput(bool isUseInput);\r
};\r
\r
-#endif // CONFIG_MESSAGE_H
+#endif // CONFIG_MESSAGE_H\r
#include <Config_Common.h>
#include <Config_FeatureMessage.h>
#include <Config_FeatureReader.h>
-#include <Event_Message.h>
-#include <Event_Loop.h>
+#include <Events_Message.h>
+#include <Events_Loop.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
void Config_FeatureReader::processNode(xmlNodePtr theNode)
{
- Event_ID aMenuItemEvent = Event_Loop::eventByName(myEventGenerated);
+ Events_ID aMenuItemEvent = Events_Loop::eventByName(myEventGenerated);
if (isNode(theNode, NODE_FEATURE, NULL)) {
- Event_Loop* aEvLoop = Event_Loop::loop();
+ Events_Loop* aEvLoop = Events_Loop::loop();
Config_FeatureMessage aMessage(aMenuItemEvent, this);
fillFeature(theNode, aMessage);
//If a feature has xml definition for it's widget:
#include <Config_PointerMessage.h>
-Config_PointerMessage::Config_PointerMessage(const Event_ID theId, const void* theParent)
- : Event_Message(theId, theParent), myPointer(0)
+Config_PointerMessage::Config_PointerMessage(const Events_ID theId, const void* theParent)
+ : Events_Message(theId, theParent), myPointer(0)
{
}
#define PARTSET_MESSAGE_H_
#include <Config.h>
-#include <Event_Message.h>
+#include <Events_Message.h>
/*
* A general class to pass pointers over the event loop.
*/
-class CONFIG_EXPORT Config_PointerMessage: public Event_Message
+class CONFIG_EXPORT Config_PointerMessage: public Events_Message
{
public:
- Config_PointerMessage(const Event_ID theId, const void* theParent = 0);
+ Config_PointerMessage(const Events_ID theId, const void* theParent = 0);
virtual ~Config_PointerMessage();
void* pointer() const;
#include <Config_XMLReader.h>
-#include <Event_Loop.h>
+#include <Events_Loop.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
+++ /dev/null
-INCLUDE(Common)
-
-SET(PROJECT_HEADERS
- Event.h
- Event_Message.h
- Event_Listener.h
- Event_Loop.h
-)
-
-SET(PROJECT_SOURCES
- Event_Message.cpp
- Event_Listener.cpp
- Event_Loop.cpp
-)
-
-ADD_DEFINITIONS(-DEVENT_EXPORTS)
-ADD_LIBRARY(Event SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
-
-TARGET_LINK_LIBRARIES(Event ${PROJECT_LIBRARIES})
-
-INSTALL(TARGETS Event DESTINATION bin)
+++ /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
-// File: Event_Listener.cxx
-// Created: Thu Mar 13 2014
-// Author: Mikhail PONIKAROV
-
-#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_Loop.hxx
-// Created: Thu Mar 13 2014
-// Author: Mikhail PONIKAROV
-
-#include <Event_Loop.h>
-
-#include <string>
-#include <cstring>
-
-using namespace std;
-
-Event_Loop* Event_Loop::loop()
-{
- // initialized on initialization of the application
- static Event_Loop MAIN_LOOP;
- return &MAIN_LOOP;
-}
-
-Event_ID Event_Loop::eventByName(const char* theName)
-{
- ///! All events created in this session, uniquely identified by the text and char pointer
- static map<string, char*> CREATED_EVENTS;
- char* aResult;
- string aName(theName);
- map<string, char*>::iterator aFound = CREATED_EVENTS.find(aName);
- if (aFound == CREATED_EVENTS.end()) { //not created yet
- aResult = strdup(theName); // copy to make unique internal pointer
- CREATED_EVENTS[aName] = aResult;
- } else
- aResult = aFound->second;
-
- return Event_ID(aResult);
-}
-
-void Event_Loop::send(Event_Message& theMessage)
-{
- // TO DO: make it in thread and wit husage of semaphores
-
- map<char*, map<void*, list<Event_Listener*> > >::iterator aFindID = myListeners.find(
- theMessage.eventID().eventText());
- if (aFindID != myListeners.end()) {
- map<void*, list<Event_Listener*> >::iterator aFindSender = aFindID->second.find(
- theMessage.sender());
- if (aFindSender != aFindID->second.end()) {
- list<Event_Listener*>& aListeners = aFindSender->second;
- for(list<Event_Listener*>::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++)
- (*aL)->processEvent(&theMessage);
- }
- if (theMessage.sender()) { // also call for NULL senders registered
- aFindSender = aFindID->second.find(NULL);
- if (aFindSender != aFindID->second.end()) {
- list<Event_Listener*>& aListeners = aFindSender->second;
- for(list<Event_Listener*>::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++)
- (*aL)->processEvent(&theMessage);
- }
- }
- }
-}
-
-void Event_Loop::registerListener(Event_Listener* theListener, const Event_ID theID,
- void* theSender)
-{
- map<char*, map<void*, list<Event_Listener*> > >::iterator aFindID = myListeners.find(
- theID.eventText());
- if (aFindID == myListeners.end()) { // create container associated with ID
- myListeners[theID.eventText()] = map<void*, list<Event_Listener*> >();
- aFindID = myListeners.find(theID.eventText());
- }
-
- map<void*, list<Event_Listener*> >::iterator aFindSender = aFindID->second.find(theSender);
- if (aFindSender == aFindID->second.end()) { // create container associated with sender
- aFindID->second[theSender] = list<Event_Listener*>();
- aFindSender = aFindID->second.find(theSender);
- }
- // check that listener was not registered wit hsuch parameters before
- list<Event_Listener*>& aListeners = aFindSender->second;
- for(list<Event_Listener*>::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++)
- if (*aL == theListener)
- return; // avoid duplicates
-
- aListeners.push_back(theListener);
-}
+++ /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_Message.cxx
-// Created: Thu Mar 13 2014
-// Author: Mikhail PONIKAROV
-
-#include <Event_Message.h>
+++ /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)
- : myEventId(theID), mySender((void*) theSender) {}
- //! do nothing in the destructor yet
- 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() const {return mySender;}
-};
-
-#endif
--- /dev/null
+INCLUDE(Common)
+
+SET(PROJECT_HEADERS
+ Events.h
+ Events_Message.h
+ Events_Listener.h
+ Events_Loop.h
+)
+
+SET(PROJECT_SOURCES
+ Events_Message.cpp
+ Events_Listener.cpp
+ Events_Loop.cpp
+)
+
+ADD_DEFINITIONS(-DEVENTS_EXPORTS)
+ADD_LIBRARY(Events SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+
+TARGET_LINK_LIBRARIES(Events ${PROJECT_LIBRARIES})
+
+INSTALL(TARGETS Events DESTINATION bin)
--- /dev/null
+#ifndef EVENTS_H
+#define EVENTS_H
+
+#if defined EVENTS_EXPORTS
+#if defined WIN32
+#define EVENTS_EXPORT __declspec( dllexport )
+#else
+#define EVENTS_EXPORT
+#endif
+#else
+#if defined WIN32
+#define EVENTS_EXPORT __declspec( dllimport )
+#else
+#define EVENTS_EXPORT
+#endif
+#endif
+
+#endif
--- /dev/null
+// File: Events_Listener.cxx
+// Created: Thu Mar 13 2014
+// Author: Mikhail PONIKAROV
+
+#include <Events_Listener.h>
--- /dev/null
+// File: Events_Listener.hxx
+// Created: Thu Mar 13 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Events_Listener_HeaderFile
+#define Events_Listener_HeaderFile
+
+#include <Events.h>
+class Events_Message;
+
+/**\class Events_Listener
+ * \ingroup EventsLoop
+ * \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 EVENTS_EXPORT Events_Listener {
+
+public:
+ //! This method is called by loop when the event is started to process.
+ virtual void processEvent(const Events_Message* theMessage) = 0;
+};
+
+#endif
--- /dev/null
+// File: Events_Loop.hxx
+// Created: Thu Mar 13 2014
+// Author: Mikhail PONIKAROV
+
+#include <Events_Loop.h>
+
+#include <string>
+#include <cstring>
+
+using namespace std;
+
+Events_Loop* Events_Loop::loop()
+{
+ // initialized on initialization of the application
+ static Events_Loop MAIN_LOOP;
+ return &MAIN_LOOP;
+}
+
+Events_ID Events_Loop::eventByName(const char* theName)
+{
+ ///! All events created in this session, uniquely identified by the text and char pointer
+ static map<string, char*> CREATED_EVENTS;
+ char* aResult;
+ string aName(theName);
+ map<string, char*>::iterator aFound = CREATED_EVENTS.find(aName);
+ if (aFound == CREATED_EVENTS.end()) { //not created yet
+ aResult = strdup(theName); // copy to make unique internal pointer
+ CREATED_EVENTS[aName] = aResult;
+ } else
+ aResult = aFound->second;
+
+ return Events_ID(aResult);
+}
+
+void Events_Loop::send(Events_Message& theMessage)
+{
+ // TO DO: make it in thread and wit husage of semaphores
+
+ map<char*, map<void*, list<Events_Listener*> > >::iterator aFindID = myListeners.find(
+ theMessage.eventID().eventText());
+ if (aFindID != myListeners.end()) {
+ map<void*, list<Events_Listener*> >::iterator aFindSender = aFindID->second.find(
+ theMessage.sender());
+ if (aFindSender != aFindID->second.end()) {
+ list<Events_Listener*>& aListeners = aFindSender->second;
+ for(list<Events_Listener*>::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++)
+ (*aL)->processEvent(&theMessage);
+ }
+ if (theMessage.sender()) { // also call for NULL senders registered
+ aFindSender = aFindID->second.find(NULL);
+ if (aFindSender != aFindID->second.end()) {
+ list<Events_Listener*>& aListeners = aFindSender->second;
+ for(list<Events_Listener*>::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++)
+ (*aL)->processEvent(&theMessage);
+ }
+ }
+ }
+}
+
+void Events_Loop::registerListener(Events_Listener* theListener, const Events_ID theID,
+ void* theSender)
+{
+ map<char*, map<void*, list<Events_Listener*> > >::iterator aFindID = myListeners.find(
+ theID.eventText());
+ if (aFindID == myListeners.end()) { // create container associated with ID
+ myListeners[theID.eventText()] = map<void*, list<Events_Listener*> >();
+ aFindID = myListeners.find(theID.eventText());
+ }
+
+ map<void*, list<Events_Listener*> >::iterator aFindSender = aFindID->second.find(theSender);
+ if (aFindSender == aFindID->second.end()) { // create container associated with sender
+ aFindID->second[theSender] = list<Events_Listener*>();
+ aFindSender = aFindID->second.find(theSender);
+ }
+ // check that listener was not registered wit hsuch parameters before
+ list<Events_Listener*>& aListeners = aFindSender->second;
+ for(list<Events_Listener*>::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++)
+ if (*aL == theListener)
+ return; // avoid duplicates
+
+ aListeners.push_back(theListener);
+}
--- /dev/null
+// File: Events_Loop.hxx
+// Created: Thu Mar 13 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Events_Loop_HeaderFile
+#define Events_Loop_HeaderFile
+
+#include <Events_Message.h>
+#include <Events_Listener.h>
+
+#include <map>
+#include <list>
+
+/**\class Events_Lopp
+ * \ingroup EventsLoop
+ * \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 Events_Loop {
+ std::map<char*, std::map<void*, std::list<Events_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
+ Events_Loop() {};
+public:
+ ///! Returns the main object of the loop, one per application.
+ EVENTS_EXPORT static Events_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.
+ EVENTS_EXPORT static Events_ID eventByName(const char* theName);
+
+ //! Allows to send an event
+ EVENTS_EXPORT void send(Events_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
+ EVENTS_EXPORT void registerListener(Events_Listener* theListener, const Events_ID theID,
+ void* theSender = 0);
+};
+
+#endif
--- /dev/null
+// File: Events_Message.cxx
+// Created: Thu Mar 13 2014
+// Author: Mikhail PONIKAROV
+
+#include <Events_Message.h>
--- /dev/null
+// File: Events_Message.hxx
+// Created: Thu Mar 13 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Events_Message_HeaderFile
+#define Events_Message_HeaderFile
+
+#include <Events.h>
+
+/**\class Events_ID
+ * \ingroup EventsLoop
+ * \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 EVENTS_EXPORT Events_ID {
+ char* myID; ///< pointer to the text-identifier of the event, unique pointer for all events of such type
+
+ Events_ID(char* theID) {myID = theID;}
+
+ friend class Events_Loop;
+public:
+ /// Returns the text-identifier of the event (for debugging reasons)
+ char* eventText() const {return myID;}
+ /// Allows to compare identifiers
+ bool operator==(const Events_ID& theID) const {return myID == theID.myID;}
+};
+
+/**\class Events_Message
+ * \ingroup EventsLoop
+ * \brief Message for communication between sender and listener of event.
+ * Normally it is inherited by the higher-level
+ */
+class EVENTS_EXPORT Events_Message {
+ Events_ID myEventsId; ///< identifier of the event
+ void* mySender; ///< the sender object
+
+public:
+
+ //! Creates the message
+ Events_Message(const Events_ID theID, const void* theSender = 0)
+ : myEventsId(theID), mySender((void*) theSender) {}
+ //! do nothing in the destructor yet
+ virtual ~Events_Message() {}
+
+ //! Returns identifier of the message
+ const Events_ID& eventID() const {return myEventsId;}
+
+ //! Returns sender of the message or NULL if it is anonymous message
+ void* sender() const {return mySender;}
+};
+
+#endif
ADD_DEFINITIONS(-DMODEL_EXPORTS ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS})
ADD_LIBRARY(Model SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
-TARGET_LINK_LIBRARIES(Model ${PROJECT_LIBRARIES} ${CAS_OCAF} ModelAPI Event Config)
+TARGET_LINK_LIBRARIES(Model ${PROJECT_LIBRARIES} ${CAS_OCAF} ModelAPI Events Config)
INCLUDE_DIRECTORIES(
../ModelAPI
- ../Event
+ ../Events
../Config
${CAS_INCLUDE_DIRS}
)
#include <Model_PluginManager.h>
#include <Model_Iterator.h>
#include <Model_Events.h>
-#include <Event_Loop.h>
+#include <Events_Loop.h>
#include <TDataStd_Integer.hxx>
#include <TDataStd_Comment.hxx>
myFeatures[aGroup].push_back(theFeature);
// event: feature is added
- static Event_ID anEvent = Event_Loop::eventByName(EVENT_FEATURE_CREATED);
+ static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_CREATED);
ModelAPI_FeatureUpdatedMessage aMsg(aThis, theFeature, anEvent);
- Event_Loop::loop()->send(aMsg);
+ Events_Loop::loop()->send(aMsg);
}
boost::shared_ptr<ModelAPI_Feature> Model_Document::feature(TDF_Label& theLabel)
aGroupNamesIter = myGroupsNames.erase(aGroupNamesIter);
// say that features were deleted from group
ModelAPI_FeatureDeletedMessage aMsg(aThis, aGroupName);
- Event_Loop::loop()->send(aMsg);
+ Events_Loop::loop()->send(aMsg);
}
// create new groups basing on the following data model update
for(; aGroupsIter.More(); aGroupsIter.Next()) {
aFIter = aFeatures.erase(aFIter);
// event: model is updated
ModelAPI_FeatureDeletedMessage aMsg(aThis, aGroupName);
- Event_Loop::loop()->send(aMsg);
+ Events_Loop::loop()->send(aMsg);
} else if (aDSTag < aFeatureTag) { // a new feature is inserted
// create a feature
boost::shared_ptr<ModelAPI_Feature> aFeature = ModelAPI_PluginManager::get()->createFeature(
aFeature->setData(aData);
aFeature->initAttributes();
// event: model is updated
- static Event_ID anEvent = Event_Loop::eventByName(EVENT_FEATURE_CREATED);
+ static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_CREATED);
ModelAPI_FeatureUpdatedMessage aMsg(aThis, aFeature, anEvent);
- Event_Loop::loop()->send(aMsg);
+ Events_Loop::loop()->send(aMsg);
if (aFIter == aFeatures.end()) {
aFeatures.push_back(aFeature);
// Author: Mikhail PONIKAROV
#include <Model_Events.h>
-#include <Event_Loop.h>
+#include <Events_Loop.h>
ModelAPI_FeatureUpdatedMessage::ModelAPI_FeatureUpdatedMessage(
const boost::shared_ptr<ModelAPI_Document>& theDoc,
- const boost::shared_ptr<ModelAPI_Feature>& theFeature, const Event_ID& theEvent)
- : Event_Message(theEvent, 0), myFeature(theFeature), myDoc(theDoc)
+ const boost::shared_ptr<ModelAPI_Feature>& theFeature, const Events_ID& theEvent)
+ : Events_Message(theEvent, 0), myFeature(theFeature), myDoc(theDoc)
{}
ModelAPI_FeatureDeletedMessage::ModelAPI_FeatureDeletedMessage(
const boost::shared_ptr<ModelAPI_Document>& theDoc, const std::string& theGroup)
- : Event_Message(messageId(), 0), myDoc(theDoc), myGroup(theGroup)
+ : Events_Message(messageId(), 0), myDoc(theDoc), myGroup(theGroup)
{
}
-const Event_ID ModelAPI_FeatureDeletedMessage::messageId()
+const Events_ID ModelAPI_FeatureDeletedMessage::messageId()
{
- static Event_ID MY_ID = Event_Loop::eventByName(EVENT_FEATURE_DELETED);
+ static Events_ID MY_ID = Events_Loop::eventByName(EVENT_FEATURE_DELETED);
return MY_ID;
}
#define Model_Events_HeaderFile
#include <Model.h>
-#include <Event_Message.h>
+#include <Events_Message.h>
#include <boost/shared_ptr.hpp>
#include <string>
static const char * EVENT_FEATURE_DELETED = "FeatureDeleted";
/// Message that feature was changed (used for Object Browser update)
-class ModelAPI_FeatureUpdatedMessage : public Event_Message {
+class ModelAPI_FeatureUpdatedMessage : public Events_Message {
boost::shared_ptr<ModelAPI_Document> myDoc; ///< document owner of the feature
boost::shared_ptr<ModelAPI_Feature> myFeature; ///< which feature is changed
public:
ModelAPI_FeatureUpdatedMessage(
const boost::shared_ptr<ModelAPI_Document>& theDoc,
const boost::shared_ptr<ModelAPI_Feature>& theFeature,
- const Event_ID& theEvent);
+ const Events_ID& theEvent);
/// Returns the feature that has been updated
boost::shared_ptr<ModelAPI_Feature> feature() const {return myFeature;}
};
/// Message that feature was deleted (used for Object Browser update)
-class ModelAPI_FeatureDeletedMessage : public Event_Message {
+class ModelAPI_FeatureDeletedMessage : public Events_Message {
boost::shared_ptr<ModelAPI_Document> myDoc; ///< document owner of the feature
std::string myGroup; ///< group identifier that contained the deleted feature
public:
const std::string& theGroup);
/// Returns the ID of this message (EVENT_FEATURE_DELETED)
- static const Event_ID messageId();
+ static const Events_ID messageId();
/// Returns the feature that has been updated
boost::shared_ptr<ModelAPI_Document> document() const {return myDoc;}
#include <Model_Data.h>
#include <Model_Document.h>
#include <Model_Application.h>
-#include <Event_Loop.h>
+#include <Events_Loop.h>
#include <Config_FeatureMessage.h>
#include <Config_ModuleReader.h>
{
myPluginsInfoLoaded = false;
//TODO(sbh): Implement static method to extract event id [SEID]
- static Event_ID aFeatureEvent = Event_Loop::eventByName("FeatureRegisterEvent");
+ static Events_ID aFeatureEvent = Events_Loop::eventByName("FeatureRegisterEvent");
ModelAPI_PluginManager::SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager>(this));
// register the configuration reading listener
- Event_Loop* aLoop = Event_Loop::loop();
+ Events_Loop* aLoop = Events_Loop::loop();
aLoop->registerListener(this, aFeatureEvent);
}
-void Model_PluginManager::processEvent(const Event_Message* theMessage)
+void Model_PluginManager::processEvent(const Events_Message* theMessage)
{
const Config_FeatureMessage* aMsg =
dynamic_cast<const Config_FeatureMessage*>(theMessage);
#include "Model.h"
#include <ModelAPI_PluginManager.h>
-#include <Event_Listener.h>
+#include <Events_Listener.h>
#include <map>
class Model_Document;
* 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
+class Model_PluginManager : public ModelAPI_PluginManager, public Events_Listener
{
bool myPluginsInfoLoaded; ///< it true if plugins information is loaded
/// map of feature IDs to plugin name
MODEL_EXPORT virtual void registerPlugin(ModelAPI_Plugin* thePlugin);
/// Processes the configuration file reading
- MODEL_EXPORT virtual void processEvent(const Event_Message* theMessage);
+ MODEL_EXPORT virtual void processEvent(const Events_Message* theMessage);
/// Is called only once, on startup of the application
Model_PluginManager();
--- /dev/null
+
+INCLUDE(FindCAS)
+
+SET(CMAKE_AUTOMOC ON)
+
+SET(PROJECT_HEADERS
+ NewGeom.h
+ NewGeom_Module.h
+)
+
+SET(PROJECT_AUTOMOC
+ ${CMAKE_CURRENT_BINARY_DIR}/XGUI_automoc.cpp
+)
+
+SET(PROJECT_SOURCES
+ NewGeom_Module.cpp
+)
+
+SET(PROJECT_RESOURCES
+ resources/LightApp.xml
+ resources/newgeom.png
+)
+
+SET(PROJECT_LIBRARIES
+ Events
+ Config
+ XGUI
+ ${QT_LIBRARIES}
+ ${LightApp}
+ ${CAM}
+ ${OCCViewer}
+)
+
+ADD_DEFINITIONS( -DNewGeom_EXPORTS ${CAS_DEFINITIONS} )
+
+INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/XGUI
+ ${PROJECT_SOURCE_DIR}/src/Events
+ ${SALOME_GUI_INCLUDE}
+ ${SALOME_KERNEL_INCLUDE}
+ ${CAS_INCLUDE_DIRS}
+)
+
+ADD_LIBRARY(NewGeom SHARED
+ ${PROJECT_SOURCES}
+ ${PROJECT_HEADERS}
+)
+
+ADD_DEPENDENCIES(NewGeom XGUI)
+
+# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
+TARGET_LINK_LIBRARIES(NewGeom ${PROJECT_LIBRARIES})
+
+INSTALL(TARGETS NewGeom DESTINATION bin)
+INSTALL(FILES ${PROJECT_RESOURCES} DESTINATION share/salome/resources/newgeom )
\ No newline at end of file
--- /dev/null
+#ifndef NewGeom_H
+#define NewGeom_H
+
+#if defined NewGeom_EXPORTS
+#if defined WIN32
+#define NewGeom_EXPORT __declspec( dllexport )
+#else
+#define NewGeom_EXPORT
+#endif
+#else
+#if defined WIN32
+#define NewGeom_EXPORT __declspec( dllimport )
+#else
+#define NewGeom_EXPORT
+#endif
+#endif
+
+#endif
+
+
+
--- /dev/null
+
+
+#include "NewGeom_Module.h"
+
+#include <LightApp_Application.h>
+#include <OCCViewer_ViewModel.h>
+
+
+
+NewGeom_Module::NewGeom_Module()
+: LightApp_Module( "NewGeom" )
+{
+}
+
+
+NewGeom_Module::~NewGeom_Module()
+{
+}
+
+void NewGeom_Module::initialize(CAM_Application* theApp)
+{
+}
+
+void NewGeom_Module::windows(QMap<int, int>& theWndMap) const
+{
+ theWndMap.insert( LightApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
+}
+
+void NewGeom_Module::viewManagers(QStringList& theList) const
+{
+ theList.append( OCCViewer_Viewer::Type() );
+}
+
+bool NewGeom_Module::activateModule(SUIT_Study* theStudy)
+{
+ return LightApp_Module::activateModule(theStudy);
+}
+
+bool NewGeom_Module::deactivateModule(SUIT_Study* theStudy)
+{
+ return LightApp_Module::deactivateModule(theStudy);
+}
+
+
--- /dev/null
+
+
+#ifndef NewGeom_Module_H
+#define NewGeom_Module_H
+
+#include "NewGeom.h"
+#include <LightApp_Module.h>
+
+class NewGeom_EXPORT NewGeom_Module: public LightApp_Module
+{
+ Q_OBJECT
+public:
+ NewGeom_Module();
+ virtual ~NewGeom_Module();
+
+ virtual void initialize( CAM_Application* theApp);
+ virtual void windows( QMap<int, int>& theWndMap) const;
+ virtual void viewManagers( QStringList& theList) const;
+
+public slots:
+ bool activateModule( SUIT_Study* theStudy);
+ bool deactivateModule( SUIT_Study* theStudy);
+
+private:
+
+};
+
+#endif
--- /dev/null
+<!--
+ Copyright (C) 2005-2013 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
+
+-->
+<document>
+ <section name="NewGeom">
+ <!-- Major module parameters -->
+ <parameter name="name" value="NewGeom"/>
+ <parameter name="icon" value="newgeom.png"/>
+ </section>
+ <section name="resources">
+ <!-- Module resources -->
+ <parameter name="NewGeom" value="${NEWGEOM_ROOT_DIR}/share/salome/resources/newgeom"/>
+ </section>
+</document>
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/XGUI
${CMAKE_SOURCE_DIR}/src/Config
- ${CMAKE_SOURCE_DIR}/src/Event
+ ${CMAKE_SOURCE_DIR}/src/Events
${CMAKE_SOURCE_DIR}/src/ModuleBase
${CMAKE_SOURCE_DIR}/src/ModelAPI
${CMAKE_SOURCE_DIR}/src/SketchPlugin
#include <Config_PointerMessage.h>
#include <Config_ModuleReader.h>
#include <Config_WidgetReader.h>
-#include <Event_Loop.h>
-#include <Event_Message.h>
+#include <Events_Loop.h>
+#include <Events_Message.h>
#include <QObject>
#include <QString>
aPartSetOp->setDescription(QString::fromStdString(aDescription));
//TODO(sbh): Implement static method to extract event id [SEID]
- static Event_ID aModuleEvent = Event_Loop::eventByName("PartSetModuleEvent");
+ static Events_ID aModuleEvent = Events_Loop::eventByName("PartSetModuleEvent");
Config_PointerMessage aMessage(aModuleEvent, this);
aMessage.setPointer(aPartSetOp);
- Event_Loop::loop()->send(aMessage);
+ Events_Loop::loop()->send(aMessage);
}
/**
+++ /dev/null
-SET(CMAKE_AUTOMOC ON)
-
-SET(PROJECT_HEADERS
- SalomeModule.h
- SalomeModule_Module.h
-)
-
-SET(PROJECT_AUTOMOC
- ${CMAKE_CURRENT_BINARY_DIR}/XGUI_automoc.cpp
-)
-
-SET(PROJECT_SOURCES
- SalomeModule_Module.cpp
-)
-
-
-SET(PROJECT_LIBRARIES
- Event
- Config
- ${QT_LIBRARIES}
- XGUI
-)
-
-ADD_DEFINITIONS( -DSalomeModule_EXPORTS ${CAS_DEFINITIONS} )
-
-INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/XGUI
- ${SALOME_GUI_INCLUDE}
- ${CAS_INCLUDE_DIRS}
-)
-
-ADD_LIBRARY(SalomeModule SHARED
- ${PROJECT_SOURCES}
- ${PROJECT_HEADERS}
-)
-
-ADD_DEPENDENCIES(SalomeModule XGUI)
-
-# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
-TARGET_LINK_LIBRARIES(SalomeModule ${PROJECT_LIBRARIES})
-
-INSTALL(TARGETS SalomeModule DESTINATION bin)
+++ /dev/null
-#ifndef SalomeModule_H
-#define SalomeModule_H
-
-#if defined SalomeModule_EXPORTS
-#if defined WIN32
-#define SalomeModule_EXPORT __declspec( dllexport )
-#else
-#define SalomeModule_EXPORT
-#endif
-#else
-#if defined WIN32
-#define SalomeModule_EXPORT __declspec( dllimport )
-#else
-#define SalomeModule_EXPORT
-#endif
-#endif
-
-#endif
-
-
-
+++ /dev/null
-
-
-#include "SalomeModule_Module.h"
-
-#include <LightApp_Application.h>
-#include <OCCViewer_ViewModel.h>
-
-
-
-SalomeModule_Module::SalomeModule_Module()
-: LightApp_Module( "NewGeom" )
-{
-}
-
-
-SalomeModule_Module::~SalomeModule_Module()
-{
-}
-
-void SalomeModule_Module::initialize(CAM_Application* theApp)
-{
-}
-
-void SalomeModule_Module::windows(QMap<int, int>& theWndMap) const
-{
- theWndMap.insert( LightApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
-}
-
-void SalomeModule_Module::viewManagers(QStringList& theList) const
-{
- theList.append( OCCViewer_Viewer::Type() );
-}
-
-bool SalomeModule_Module::activateModule(SUIT_Study* theStudy)
-{
- return LightApp_Module::activateModule(theStudy);
-}
-
-bool SalomeModule_Module::deactivateModule(SUIT_Study* theStudy)
-{
- return LightApp_Module::deactivateModule(theStudy);
-}
-
-
+++ /dev/null
-
-
-#ifndef SalomeModule_Module_H
-#define SalomeModule_Module_H
-
-#include <LightApp_Module.h>
-
-class SalomeModule_Module: public LightApp_Module
-{
- Q_OBJECT
-public:
- SalomeModule_Module();
- virtual ~SalomeModule_Module();
-
- virtual void initialize( CAM_Application* theApp);
- virtual void windows( QMap<int, int>& theWndMap) const;
- virtual void viewManagers( QStringList& theList) const;
-
-public slots:
- bool activateModule( SUIT_Study* theStudy);
- bool deactivateModule( SUIT_Study* theStudy);
-
-private:
-
-};
-
-#endif
#)
SET(PROJECT_LIBRARIES
- Event
+ Events
Config
${QT_LIBRARIES}
${CAS_VIEWER}
ADD_DEFINITIONS( -DXGUI_EXPORTS ${CAS_DEFINITIONS} )
-INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Event
+INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Events
${PROJECT_SOURCE_DIR}/src/Config
${PROJECT_SOURCE_DIR}/src/PyInterp
${PROJECT_SOURCE_DIR}/src/PyConsole
#include <ModelAPI_Data.h>
#include <Model_Events.h>
-#include <Event_Loop.h>
+#include <Events_Loop.h>
#include <QIcon>
myDocument = aMgr->currentDocument();
// Register in event loop
- Event_Loop::loop()->registerListener(this, Event_Loop::eventByName(EVENT_FEATURE_CREATED));
- Event_Loop::loop()->registerListener(this, Event_Loop::eventByName(EVENT_FEATURE_UPDATED));
- Event_Loop::loop()->registerListener(this, Event_Loop::eventByName(EVENT_FEATURE_DELETED));
+ Events_Loop::loop()->registerListener(this, Events_Loop::eventByName(EVENT_FEATURE_CREATED));
+ Events_Loop::loop()->registerListener(this, Events_Loop::eventByName(EVENT_FEATURE_UPDATED));
+ Events_Loop::loop()->registerListener(this, Events_Loop::eventByName(EVENT_FEATURE_DELETED));
// Create a top part of data tree model
myModel = new XGUI_TopDataModel(myDocument, this);
}
-void XGUI_DocumentDataModel::processEvent(const Event_Message* theMessage)
+void XGUI_DocumentDataModel::processEvent(const Events_Message* theMessage)
{
// Created object event *******************
if (QString(theMessage->eventID().eventText()) == EVENT_FEATURE_CREATED) {
#include "XGUI_Constants.h"
#include <QAbstractItemModel>
-#include <Event_Listener.h>
+#include <Events_Listener.h>
#include <QList>
* \brief This is a proxy data model for Object Browser (QTreeView).
* It contains several sub-models for generation of each sub-part of data tree.
*/
-class XGUI_EXPORT XGUI_DocumentDataModel : public QAbstractItemModel, public Event_Listener
+class XGUI_EXPORT XGUI_DocumentDataModel : public QAbstractItemModel, public Events_Listener
{
Q_OBJECT
public:
virtual ~XGUI_DocumentDataModel();
// Event Listener method
- virtual void processEvent(const Event_Message* theMessage);
+ virtual void processEvent(const Events_Message* theMessage);
virtual QVariant data(const QModelIndex& theIndex, int theRole) const;
#include <ModelAPI_Data.h>
#include <ModelAPI_AttributeDocRef.h>
-#include <Event_Loop.h>
+#include <Events_Loop.h>
#include <ModuleBase_PropPanelOperation.h>
#include <ModuleBase_Operation.h>
#include <Config_FeatureMessage.h>
{
initMenu();
//Initialize event listening
- Event_Loop* aLoop = Event_Loop::loop();
+ Events_Loop* aLoop = Events_Loop::loop();
//TODO(sbh): Implement static method to extract event id [SEID]
- Event_ID aFeatureId = aLoop->eventByName("FeatureEvent");
+ Events_ID aFeatureId = aLoop->eventByName("FeatureEvent");
aLoop->registerListener(this, aFeatureId);
- Event_ID aPartSetId = aLoop->eventByName("PartSetModuleEvent");
+ Events_ID aPartSetId = aLoop->eventByName("PartSetModuleEvent");
aLoop->registerListener(this, aPartSetId);
activateModule();
myMainWindow->show();
}
//******************************************************
-void XGUI_Workshop::processEvent(const Event_Message* theMessage)
+void XGUI_Workshop::processEvent(const Events_Message* theMessage)
{
- static Event_ID aFeatureId = Event_Loop::loop()->eventByName("FeatureEvent");
+ static Events_ID aFeatureId = Events_Loop::loop()->eventByName("FeatureEvent");
if (theMessage->eventID() == aFeatureId) {
const Config_FeatureMessage* aFeatureMsg =
dynamic_cast<const Config_FeatureMessage*>(theMessage);
#define XGUI_WORKSHOP_H
#include "XGUI.h"
-#include <Event_Listener.h>
+#include <Events_Listener.h>
#include <QObject>
#include <QMap>
* \ingroup GUI
* \brief Class which defines a configuration of the application (Workshop) and launches it.
*/
-class XGUI_EXPORT XGUI_Workshop: public QObject, public Event_Listener
+class XGUI_EXPORT XGUI_Workshop: public QObject, public Events_Listener
{
Q_OBJECT
public:
//! Creates and adds a new workbench (menu group) with the given name and returns it
XGUI_Workbench* addWorkbench(const QString& theName);
- //! Redefinition of Event_Listener method
- virtual void processEvent(const Event_Message* theMessage);
+ //! Redefinition of Events_Listener method
+ virtual void processEvent(const Events_Message* theMessage);
public slots:
void updateCommandStatus();