]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Adaptation to SALOME environment (Issue #31)
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 24 Apr 2014 08:41:22 +0000 (12:41 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 24 Apr 2014 08:41:22 +0000 (12:41 +0400)
50 files changed:
CMakeCommon/FindSalome.cmake
CMakeLists.txt
msvc9_env_Salome.bat
salomeRun.bat [new file with mode: 0644]
src/Config/CMakeLists.txt
src/Config/Config_FeatureMessage.cpp
src/Config/Config_FeatureMessage.h
src/Config/Config_FeatureReader.cpp
src/Config/Config_PointerMessage.cpp
src/Config/Config_PointerMessage.h
src/Config/Config_XMLReader.cpp
src/Event/CMakeLists.txt [deleted file]
src/Event/Event.h [deleted file]
src/Event/Event_Listener.cpp [deleted file]
src/Event/Event_Listener.h [deleted file]
src/Event/Event_Loop.cpp [deleted file]
src/Event/Event_Loop.h [deleted file]
src/Event/Event_Message.cpp [deleted file]
src/Event/Event_Message.h [deleted file]
src/Events/CMakeLists.txt [new file with mode: 0644]
src/Events/Events.h [new file with mode: 0644]
src/Events/Events_Listener.cpp [new file with mode: 0644]
src/Events/Events_Listener.h [new file with mode: 0644]
src/Events/Events_Loop.cpp [new file with mode: 0644]
src/Events/Events_Loop.h [new file with mode: 0644]
src/Events/Events_Message.cpp [new file with mode: 0644]
src/Events/Events_Message.h [new file with mode: 0644]
src/Model/CMakeLists.txt
src/Model/Model_Document.cpp
src/Model/Model_Events.cpp
src/Model/Model_Events.h
src/Model/Model_PluginManager.cpp
src/Model/Model_PluginManager.h
src/NewGeom/CMakeLists.txt [new file with mode: 0644]
src/NewGeom/NewGeom.h [new file with mode: 0644]
src/NewGeom/NewGeom_Module.cpp [new file with mode: 0644]
src/NewGeom/NewGeom_Module.h [new file with mode: 0644]
src/NewGeom/resources/LightApp.xml [new file with mode: 0644]
src/NewGeom/resources/newgeom.png [new file with mode: 0644]
src/PartSet/CMakeLists.txt
src/PartSet/PartSet_Module.cpp
src/SalomeModule/CMakeLists.txt [deleted file]
src/SalomeModule/SalomeModule.h [deleted file]
src/SalomeModule/SalomeModule_Module.cpp [deleted file]
src/SalomeModule/SalomeModule_Module.h [deleted file]
src/XGUI/CMakeLists.txt
src/XGUI/XGUI_DocumentDataModel.cpp
src/XGUI/XGUI_DocumentDataModel.h
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

index bf82cdecc985446aa35b54df4901f5ade465135d..c2403c2702b3d5f09110d1550ea54bad21a4d3e1 100644 (file)
@@ -1,12 +1,53 @@
 
 
+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})
index 9f7435c67349d720898009651113ecc4b797faae..f29f9a8ba61c9747cc9c805a61fd0535e4d4169e 100644 (file)
@@ -21,7 +21,7 @@ ENDIF(UNIX)
 
 
 ADD_SUBDIRECTORY (src/Config)
-ADD_SUBDIRECTORY (src/Event)
+ADD_SUBDIRECTORY (src/Events)
 ADD_SUBDIRECTORY (src/Model)
 ADD_SUBDIRECTORY (src/ModelAPI)
 ADD_SUBDIRECTORY (src/GeomAPI)
@@ -37,6 +37,6 @@ ADD_SUBDIRECTORY (src/PyInterp)
 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})
index 043e2c951e95dcca03e91e991bf6179ec24a5cf7..15317ad207b274479b452c7f05ce26564c502559 100644 (file)
@@ -57,6 +57,7 @@ call "%PDIR%\env_compile.bat"
 @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" (
@@ -71,4 +72,6 @@ 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
diff --git a/salomeRun.bat b/salomeRun.bat
new file mode 100644 (file)
index 0000000..3738b2f
--- /dev/null
@@ -0,0 +1,16 @@
+@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
index 92aee7ca611efc77eface8cad5f13fa00012be14..a501bcfa7030116808ce7f2941952bb41e5d1802 100644 (file)
@@ -1,7 +1,7 @@
 INCLUDE(Common)
 INCLUDE(XMLProcessing)
 
-INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Event) 
+INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Events
 
 SET(PROJECT_HEADERS
   Config.h
@@ -30,7 +30,7 @@ SET(XML_RESOURCES
 )
 
 SET(PROJECT_LIBRARIES
-    Event
+    Events
     ${LIBXML2_LIBRARIES}
 )
 
index 209bb7aa2fef6119f383c7b4d26ca4b8ceea64ad..2da65741751e84095ff74d22cce605efb2b33baf 100644 (file)
@@ -3,8 +3,8 @@
  */
 #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 = "";
index 900d547d3474239b9a8827a823c79aa6cc0b4867..a7928800a5e5dc36fe20c07f58943bb6030dc937 100644 (file)
@@ -2,7 +2,7 @@
 #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
@@ -11,7 +11,7 @@
  * 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
@@ -26,8 +26,8 @@ class Config_FeatureMessage: public Event_Message
   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
@@ -56,4 +56,4 @@ public:
   CONFIG_EXPORT void setUseInput(bool isUseInput);\r
 };\r
 \r
-#endif // CONFIG_MESSAGE_H
+#endif // CONFIG_MESSAGE_H\r
index 50d72e99230ebcc07bf48e30e017140644a6d25d..229c4cec9871fd61dd101ded68aa6d81bbd022c3 100644 (file)
@@ -9,8 +9,8 @@
 #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>
@@ -38,9 +38,9 @@ Config_FeatureReader::~Config_FeatureReader()
 
 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:
index cc4b353d5dbbf2f496767a1d4d10c101cc8c74cf..91e9d10f335d14df142ce0e6743aa8bbacaf7bac 100644 (file)
@@ -7,8 +7,8 @@
 
 #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)
 {
 
 }
index e0ac3e44094c5329969604194d2b4e869164f9c2..f108d3edeaa50bc7ad81f1071026fd6f5825484f 100644 (file)
@@ -9,15 +9,15 @@
 #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;
index 002c9df493ab611ef9d22774d6147ce70e2800e3..f804cd501bb5a949144625764274b33b623012eb 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <Config_XMLReader.h>
 
-#include <Event_Loop.h>
+#include <Events_Loop.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
diff --git a/src/Event/CMakeLists.txt b/src/Event/CMakeLists.txt
deleted file mode 100644 (file)
index 6319166..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-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)
diff --git a/src/Event/Event.h b/src/Event/Event.h
deleted file mode 100644 (file)
index d99cd00..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#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
diff --git a/src/Event/Event_Listener.cpp b/src/Event/Event_Listener.cpp
deleted file mode 100644 (file)
index ffb56c7..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-// File:       Event_Listener.cxx
-// Created:    Thu Mar 13 2014
-// Author:     Mikhail PONIKAROV
-
-#include <Event_Listener.h>
diff --git a/src/Event/Event_Listener.h b/src/Event/Event_Listener.h
deleted file mode 100644 (file)
index c47d28d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// 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
diff --git a/src/Event/Event_Loop.cpp b/src/Event/Event_Loop.cpp
deleted file mode 100644 (file)
index c938dbe..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-// 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);
-}
diff --git a/src/Event/Event_Loop.h b/src/Event/Event_Loop.h
deleted file mode 100644 (file)
index 60ddacd..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// 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
diff --git a/src/Event/Event_Message.cpp b/src/Event/Event_Message.cpp
deleted file mode 100644 (file)
index 764ed82..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-// File:       Event_Message.cxx
-// Created:    Thu Mar 13 2014
-// Author:     Mikhail PONIKAROV
-
-#include <Event_Message.h>
diff --git a/src/Event/Event_Message.h b/src/Event/Event_Message.h
deleted file mode 100644 (file)
index 0c27020..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// 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
diff --git a/src/Events/CMakeLists.txt b/src/Events/CMakeLists.txt
new file mode 100644 (file)
index 0000000..08c3903
--- /dev/null
@@ -0,0 +1,21 @@
+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)
diff --git a/src/Events/Events.h b/src/Events/Events.h
new file mode 100644 (file)
index 0000000..928056c
--- /dev/null
@@ -0,0 +1,18 @@
+#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
diff --git a/src/Events/Events_Listener.cpp b/src/Events/Events_Listener.cpp
new file mode 100644 (file)
index 0000000..8a7720c
--- /dev/null
@@ -0,0 +1,5 @@
+// File:       Events_Listener.cxx
+// Created:    Thu Mar 13 2014
+// Author:     Mikhail PONIKAROV
+
+#include <Events_Listener.h>
diff --git a/src/Events/Events_Listener.h b/src/Events/Events_Listener.h
new file mode 100644 (file)
index 0000000..2fdcb09
--- /dev/null
@@ -0,0 +1,25 @@
+// 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
diff --git a/src/Events/Events_Loop.cpp b/src/Events/Events_Loop.cpp
new file mode 100644 (file)
index 0000000..6c8bb47
--- /dev/null
@@ -0,0 +1,82 @@
+// 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);
+}
diff --git a/src/Events/Events_Loop.h b/src/Events/Events_Loop.h
new file mode 100644 (file)
index 0000000..893ecb1
--- /dev/null
@@ -0,0 +1,46 @@
+// 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
diff --git a/src/Events/Events_Message.cpp b/src/Events/Events_Message.cpp
new file mode 100644 (file)
index 0000000..6de3839
--- /dev/null
@@ -0,0 +1,5 @@
+// File:       Events_Message.cxx
+// Created:    Thu Mar 13 2014
+// Author:     Mikhail PONIKAROV
+
+#include <Events_Message.h>
diff --git a/src/Events/Events_Message.h b/src/Events/Events_Message.h
new file mode 100644 (file)
index 0000000..1d5a57d
--- /dev/null
@@ -0,0 +1,57 @@
+// 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
index 310c9f8a305d4a271dd6748fd9549dffff3635f7..24bee85be889d3455ad8ed342b4e6271a187f057 100644 (file)
@@ -26,11 +26,11 @@ SET(PROJECT_SOURCES
 
 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}
 )
index c022362e82d372f38824e1f6b4d6a26724fad4ee..d33caaae8109707c31480b20d5ef28a1aa43813f 100644 (file)
@@ -9,7 +9,7 @@
 #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>
@@ -236,9 +236,9 @@ void Model_Document::addFeature(const boost::shared_ptr<ModelAPI_Feature> theFea
   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)
@@ -371,7 +371,7 @@ void Model_Document::synchronizeFeatures()
     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()) {
@@ -408,7 +408,7 @@ void Model_Document::synchronizeFeatures()
         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(
@@ -422,9 +422,9 @@ void Model_Document::synchronizeFeatures()
         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);
index a83e9cabd738ea63e2a1a3728e01c432ee44c6f0..b71ecff50e068a2ab7d75775888446271c43ea6c 100644 (file)
@@ -3,23 +3,23 @@
 // 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;
 }
index 81828bf308e78d252ad75045d4433a711f02ab3a..feda6ab0263a8ce85e458916ab77227e9c8956d0 100644 (file)
@@ -6,7 +6,7 @@
 #define Model_Events_HeaderFile
 
 #include <Model.h>
-#include <Event_Message.h>
+#include <Events_Message.h>
 #include <boost/shared_ptr.hpp>
 #include <string>
 
@@ -21,7 +21,7 @@ static const char * EVENT_FEATURE_UPDATED = "FeatureUpdated";
 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:
@@ -29,7 +29,7 @@ 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;}
@@ -38,7 +38,7 @@ public:
 };
 
 /// 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:
@@ -47,7 +47,7 @@ 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;}
index e816fdd4a2edc81ab38a75ad84fc9ab480c6bc23..2750614e7555e98a25bd973d215fb266ed39f5df 100644 (file)
@@ -8,7 +8,7 @@
 #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>
 
@@ -64,15 +64,15 @@ Model_PluginManager::Model_PluginManager()
 {
   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);
index 018f705b1451ea409efcef61abd9b94491bddab3..7f405573fea644010a96dc6c53757e2be75b83af 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "Model.h"
 #include <ModelAPI_PluginManager.h>
-#include <Event_Listener.h>
+#include <Events_Listener.h>
 #include <map>
 
 class Model_Document;
@@ -18,7 +18,7 @@ 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
@@ -45,7 +45,7 @@ public:
   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();
diff --git a/src/NewGeom/CMakeLists.txt b/src/NewGeom/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4d908a2
--- /dev/null
@@ -0,0 +1,54 @@
+
+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
diff --git a/src/NewGeom/NewGeom.h b/src/NewGeom/NewGeom.h
new file mode 100644 (file)
index 0000000..78f0f99
--- /dev/null
@@ -0,0 +1,21 @@
+#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
+
+
+
diff --git a/src/NewGeom/NewGeom_Module.cpp b/src/NewGeom/NewGeom_Module.cpp
new file mode 100644 (file)
index 0000000..4fe5e15
--- /dev/null
@@ -0,0 +1,44 @@
+
+
+#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);
+}
+
+
diff --git a/src/NewGeom/NewGeom_Module.h b/src/NewGeom/NewGeom_Module.h
new file mode 100644 (file)
index 0000000..bd6886e
--- /dev/null
@@ -0,0 +1,28 @@
+
+
+#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
diff --git a/src/NewGeom/resources/LightApp.xml b/src/NewGeom/resources/LightApp.xml
new file mode 100644 (file)
index 0000000..db530bd
--- /dev/null
@@ -0,0 +1,31 @@
+<!--
+  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>
diff --git a/src/NewGeom/resources/newgeom.png b/src/NewGeom/resources/newgeom.png
new file mode 100644 (file)
index 0000000..d4827e2
Binary files /dev/null and b/src/NewGeom/resources/newgeom.png differ
index 1554472a2eef3d4f0a14f7d6a9154cc5504576ef..260da21aa23d88a18d2849ad6bcacbab6b84d112 100644 (file)
@@ -44,7 +44,7 @@ SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
 
 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
index f82eee4b2249fe239766cb03c221710028381f39..a4e64417be2e86752d8a2af7296b62c42d2cdb2d 100644 (file)
@@ -12,8 +12,8 @@
 #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>
@@ -84,10 +84,10 @@ void PartSet_Module::onFeatureTriggered()
   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);
 }
 
 /**
diff --git a/src/SalomeModule/CMakeLists.txt b/src/SalomeModule/CMakeLists.txt
deleted file mode 100644 (file)
index 2749ccf..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-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)
diff --git a/src/SalomeModule/SalomeModule.h b/src/SalomeModule/SalomeModule.h
deleted file mode 100644 (file)
index e8977e5..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#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
-
-
-
diff --git a/src/SalomeModule/SalomeModule_Module.cpp b/src/SalomeModule/SalomeModule_Module.cpp
deleted file mode 100644 (file)
index 1190e77..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-#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);
-}
-
-
diff --git a/src/SalomeModule/SalomeModule_Module.h b/src/SalomeModule/SalomeModule_Module.h
deleted file mode 100644 (file)
index d4acd27..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-#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
index becc47ee3f97d01ea89c62a6c75d3b4dd48c5280..a246e4060ebcd25ac868fb9babc49dabc0fc7bcd 100644 (file)
@@ -65,7 +65,7 @@ SET(PROJECT_RESOURCES
 #)
 
 SET(PROJECT_LIBRARIES
-    Event
+    Events
     Config
        ${QT_LIBRARIES}
        ${CAS_VIEWER}
@@ -92,7 +92,7 @@ SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
 
 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
index 7fae4b2bd325b10b45585c96b233ef2cd7d62e67..50ea7c707b4e5dde0904308e794153c3e7bcb75d 100644 (file)
@@ -8,7 +8,7 @@
 #include <ModelAPI_Data.h>
 #include <Model_Events.h>
 
-#include <Event_Loop.h>
+#include <Events_Loop.h>
 
 
 #include <QIcon>
@@ -23,9 +23,9 @@ XGUI_DocumentDataModel::XGUI_DocumentDataModel(QObject* theParent)
   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);
@@ -38,7 +38,7 @@ XGUI_DocumentDataModel::~XGUI_DocumentDataModel()
 }
 
 
-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) {
index 592308ae8adcdbcb30e069f62c5a3f05fedb64ae..80d69f3b69b2bb4225589dde9c64487d15dc52da 100644 (file)
@@ -6,7 +6,7 @@
 #include "XGUI_Constants.h"
 
 #include <QAbstractItemModel>
-#include <Event_Listener.h>
+#include <Events_Listener.h>
 
 #include <QList>
 
@@ -19,7 +19,7 @@ class XGUI_TopDataModel;
  * \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:
@@ -29,7 +29,7 @@ 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;
index f606615a7b4eed8787ef791d5433bcb4fd070608..eb4552d96161ab6d21ae48bc83026b93c19dc00d 100644 (file)
@@ -19,7 +19,7 @@
 #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>
@@ -64,11 +64,11 @@ void XGUI_Workshop::startApplication()
 {
   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();
@@ -141,9 +141,9 @@ XGUI_Workbench* XGUI_Workshop::addWorkbench(const QString& theName)
 }
 
 //******************************************************
-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);
index a1c79c0b3ece2d859c9be45fde0d430ab48a3c46..f61f6e1b10f9d212aafcdb0b4524f8b6b53fc079 100644 (file)
@@ -2,7 +2,7 @@
 #define XGUI_WORKSHOP_H
 
 #include "XGUI.h"
-#include <Event_Listener.h>
+#include <Events_Listener.h>
 
 #include <QObject>
 #include <QMap>
@@ -26,7 +26,7 @@ class Config_PointerMessage;
  * \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:
@@ -55,8 +55,8 @@ 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();