Salome HOME
CMake improvement: editing of SALOME_GUI_MODE() macro, checking of optional dependenc...
authormpa <mpa@opencascade.com>
Thu, 11 Jun 2015 12:22:55 +0000 (15:22 +0300)
committermpa <mpa@opencascade.com>
Thu, 11 Jun 2015 12:22:55 +0000 (15:22 +0300)
19 files changed:
CMakeLists.txt
adm_local/cmake_files/FindSalomeGUI.cmake
src/CMakeLists.txt
src/LightApp/CMakeLists.txt
src/OCCViewer/CMakeLists.txt
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/PVViewer/CMakeLists.txt
src/PVViewer/PVViewer_Behaviors.h
src/PVViewer/PVViewer_EngineWrapper.cxx
src/PVViewer/PVViewer_EngineWrapper.h
src/PVViewer/PVViewer_LogWindowAdapter.cxx
src/PVViewer/PVViewer_ViewManager.cxx
src/PVViewer/PVViewer_ViewModel.cxx
src/PyInterp/CMakeLists.txt
src/PyInterp/PyInterp_Utils.cxx [deleted file]
src/PyInterp/PyInterp_Utils.h
src/SVTK/CMakeLists.txt
src/SVTK/SVTK_ViewWindow.cxx
src/SalomeApp/SalomeApp_Application.cxx

index 0bab824399ce34446f8a9e5db841fb95fb4842ac..a0fbbaadea1ad929f81dbce9d1de89e84372c466 100755 (executable)
@@ -277,7 +277,7 @@ INCLUDE(CMakePackageConfigHelpers)
 # List of targets in this project we want to make visible to the rest of the world.
 # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
 SET(_${PROJECT_NAME}_exposed_targets 
-    caf CAM CASCatch DDS Event LightApp LogWindow ObjBrowser OpenGLUtils
+    caf CAM CASCatch DDS Event LightApp LogWindow ObjBrowser
     QDS qtx SalomePrs SalomeStyle std SUITApp suit ViewerTools ViewerData
     ImageComposer
 )
@@ -291,7 +291,7 @@ ENDIF(SALOME_USE_SALOMEOBJECT)
 # GL specific targets:
 IF(SALOME_USE_GLVIEWER)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets 
-       GLViewer)
+       OpenGLUtils GLViewer)
 ENDIF(SALOME_USE_GLVIEWER)
 
 # VTK specific targets:
index 0f2419e2b4c0c7339e6baf3e866a9a2b9f00c5ee..59a621a8841590d9023306af0457a322b7310615 100644 (file)
@@ -51,46 +51,51 @@ MACRO(SALOME_GUI_WITH_CORBA)
   ENDIF()
 ENDMACRO(SALOME_GUI_WITH_CORBA)
 
-#----------------------------------------------------------------------------
-# FULL_GUI is a macro useful for determining whether a GUI module
-# builded in full mode
-#----------------------------------------------------------------------------
-MACRO(FULL_GUI)
-  SET(_options)
-  LIST(APPEND _options SALOME_USE_OCCVIEWER SALOME_USE_GLVIEWER SALOME_USE_VTKVIEWER
-              SALOME_USE_PLOT2DVIEWER SALOME_USE_GRAPHICSVIEW SALOME_USE_QXGRAPHVIEWER
-              SALOME_USE_SALOMEOBJECT SALOME_USE_PYCONSOLE)
-  SALOME_GUI_MODE(${_options})
-ENDMACRO(FULL_GUI)
 
 #----------------------------------------------------------------------------
 # SALOME_GUI_MODE is a macro useful for determining whether a GUI module
 # builded in particular mode 
 #----------------------------------------------------------------------------
 #########################################################################
-# FULL_GUI()
+# SALOME_GUI_MODE()
 # 
-# USAGE: FULL_GUI(_options)
+# USAGE: SALOME_GUI_MODE(_options)
 #
 # ARGUMENTS:
 #   _options [input] List - The list of CMake options given to SALOME GUI
 #
-MACRO(SALOME_GUI_MODE _options)
-  MESSAGE(STATUS "Checking status of GUI options ${_options}")
-  SET(_message) 
-  FOREACH(_option ${_options})
-    IF(NOT ${_option})
-      LIST(APPEND _message ${_option})
+# Notes:
+# The arguments list can include "OPTIONAL" keywords:
+#  * All arguments preceded by "OPTIONAL" keyword are mandatory for current module.
+#    If GUI module was compiled without this functionality, further installation 
+#    of the current module becomes impossible.
+#  * All arguments following "OPTIONAL" keyword are optional for current module, which
+#    uses this functionality, but can be installed without it.
+#
+MACRO(SALOME_GUI_MODE)
+  MESSAGE(STATUS "")
+  MESSAGE(STATUS "  Checking status of GUI options")
+  MESSAGE(STATUS "  ==================================== ")
+  MESSAGE(STATUS "")
+  SET(_message)
+  SET(_length 25)   
+  SET(_is_optional OFF)
+  FOREACH(_option ${ARGN})
+    IF(${_option} STREQUAL "OPTIONAL")
+      SET(_is_optional ON)
+      MESSAGE(STATUS "  Optional:")
+    ELSE()
+      SALOME_JUSTIFY_STRING(${_option} ${_length} _option_name)
+      MESSAGE(STATUS "  * ${_option_name}  ->  ${${_option}}")
+      IF(NOT ${_option} AND NOT ${_is_optional})
+        LIST(APPEND _message ${_option})
+      ENDIF()
     ENDIF()
   ENDFOREACH()
+  MESSAGE(STATUS "")
+  
   IF(_message)
-    SET(_message "We absolutely need a Salome GUI module in full mode.\nThe following options should be set to ON when building GUI module:\n${_message}\n")
-    IF(_corba_message)
-      MESSAGE(FATAL_ERROR "${_corba_message}\n${_message}")
-    ELSE()
-      MESSAGE(FATAL_ERROR "${_message}")
-    ENDIF()
-  ELSEIF(_corba_message)
-    MESSAGE(FATAL_ERROR "${_corba_message}") 
-  ENDIF() 
+    SET(_message "We absolutely need a Salome GUI module in special mode. The following options should be set to ON when building GUI module: \n${_message}\n")
+    MESSAGE(FATAL_ERROR "${_message}")
+  ENDIF()
 ENDMACRO(SALOME_GUI_MODE)
index f3d3f8aab79d925df03f258455e7a0c760f6a6e9..b1baf45763ba62ab7fc21400e5b77d34e216d5ee 100755 (executable)
@@ -22,7 +22,7 @@
 ##
 SET(SUBDIRS_COMMON
   CASCatch Qtx HelpBrowser Style DDS QDS ObjBrowser SUIT SUITApp STD CAF
-  CAM LogWindow Prs Event OpenGLUtils ViewerData ViewerTools ImageComposer GUI_PY
+  CAM LogWindow Prs Event ViewerData ViewerTools ImageComposer GUI_PY
 )
 
 ##
@@ -36,7 +36,7 @@ ENDIF(SALOME_USE_SALOMEOBJECT)
 # GL viewer
 ##
 IF(SALOME_USE_GLVIEWER)
-  SET(SUBDIRS_GLVIEWER GLViewer)
+  SET(SUBDIRS_GLVIEWER OpenGLUtils GLViewer)
 ENDIF(SALOME_USE_GLVIEWER)
 
 ##
index c295aa78f5266837e746f3de3dd2caf03c2d5c14..9b39c65e80202d549ee302f54f26c2b910ff2a2c 100755 (executable)
@@ -101,7 +101,7 @@ SET(_link_LIBRARIES
   ${CAS_KERNEL}
   ${QT_LIBRARIES}
   ${HDF5_LIBRARIES}
-  CASCatch qtx suit std SalomeStyle SalomePrs CAM LogWindow ObjBrowser 
+  CASCatch qtx suit std SalomeStyle SalomePrs CAM LogWindow ObjBrowser Event 
   ${KERNEL_SalomeHDFPersist} ${KERNEL_SALOMELocalTrace}
 )
 IF(SALOME_USE_SALOMEOBJECT)
index e3282c54c6150b7602d1a7b1fff9b1c96548843b..17f5c45a854b3ef787106dcca61eb5d44121ef6f 100755 (executable)
@@ -32,11 +32,15 @@ INCLUDE_DIRECTORIES(
   ${PTHREAD_INCLUDE_DIR}
   ${PROJECT_SOURCE_DIR}/src/CASCatch
   ${PROJECT_SOURCE_DIR}/src/Qtx
-  ${PROJECT_SOURCE_DIR}/src/OpenGLUtils
   ${PROJECT_SOURCE_DIR}/src/SUIT
   ${PROJECT_SOURCE_DIR}/src/ViewerData
   ${PROJECT_SOURCE_DIR}/src/ViewerTools
 )
+IF(SALOME_USE_GLVIEWER)
+  INCLUDE_DIRECTORIES(
+    ${PROJECT_SOURCE_DIR}/src/OpenGLUtils
+    )
+ENDIF()
 
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS})
@@ -45,9 +49,15 @@ ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS})
 SET(_link_LIBRARIES
   ${OPENGL_LIBRARIES} ${QT_LIBRARIES} ${CAS_KERNEL} ${CAS_VIEWER} ${CAS_TKGeomAlgo}
   ${CAS_TKTopAlgo} ${CAS_TKG2d} ${CAS_TKOpenGl}
-  CASCatch qtx suit OpenGLUtils ViewerTools ViewerData
+  CASCatch qtx suit ViewerTools ViewerData
 )
 
+IF(SALOME_USE_GLVIEWER)
+  LIST(APPEND _link_LIBRARIES
+    OpenGLUtils
+    )
+ENDIF()
+
 # --- headers ---
 
 # header files / to be processed by moc
index c7d66be64b2ee124868822988a175c4e788cd844..08f89e26992ef4e03c1f1e4cee1f0de4e597f85e 100755 (executable)
@@ -49,7 +49,9 @@
 #include <QtxMultiAction.h>
 #include <QtxRubberBand.h>
 
-#include <OpenGLUtils_FrameBuffer.h>
+#ifndef DISABLE_GLVIEWER
+  #include <OpenGLUtils_FrameBuffer.h>
+#endif
 
 #include <QPainter>
 #include <QTime>
@@ -2000,6 +2002,7 @@ QImage OCCViewer_ViewWindow::dumpView()
   view->Redraw(); // In order to reactivate GL context
   //view->Update();
 
+#ifndef DISABLE_GLVIEWER
   OpenGLUtils_FrameBuffer aFrameBuffer;
   if( aFrameBuffer.init( aWidth, aHeight ) )
   {
@@ -2032,6 +2035,7 @@ QImage OCCViewer_ViewWindow::dumpView()
 
   glReadPixels( p.x(), p.y(), aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE,
                 data);
+#endif
   */
 
   Image_PixMap aPix;
index 04b265cf0e766a7689865cc9c53ae872e2544191..e67c3c4be7f997b2d2c2c121f1121f45bee65925 100644 (file)
@@ -24,32 +24,28 @@ ADD_SUBDIRECTORY(resources)
 
 # --- options ---
 
-INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS} 
-    ${QT_INCLUDES}
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${CMAKE_SOURCE_DIR}/src/SUIT
-    ${CMAKE_SOURCE_DIR}/src/CAM
-    ${CMAKE_SOURCE_DIR}/src/STD
-    ${CMAKE_SOURCE_DIR}/src/Qtx
-    ${CMAKE_SOURCE_DIR}/src/Event
-    ${CMAKE_SOURCE_DIR}/src/PyInterp
-    ${CMAKE_SOURCE_DIR}/src/PyConsole
-    ${CMAKE_SOURCE_DIR}/src/LogWindow
-    )
-
-SET(_PARAVIEW_APP_COMPO_LIB
-  pqApplicationComponents
+INCLUDE_DIRECTORIES(
+  ${PROJECT_SOURCE_DIR}/src/SUIT
+  ${PROJECT_SOURCE_DIR}/src/STD
+  ${PROJECT_SOURCE_DIR}/src/Qtx
+  ${PROJECT_SOURCE_DIR}/src/Event
+  ${PROJECT_SOURCE_DIR}/src/PyInterp
+  ${CMAKE_SOURCE_DIR}/src/LogWindow
   )
 
-ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
-ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${PYTHON_DEFINITIONS})
+ADD_DEFINITIONS(
+  ${KERNEL_DEFINITIONS}
+  ${PYTHON_DEFINITIONS}
+  )
 
 SET(_link_LIBRARIES 
-  ${KERNEL_LDFLAGS} ${KERNEL_SALOMELocalTrace} ${KERNEL_OpUtil} 
-  ${GUI_LDFLAGS} suit Event PyInterp 
-  ${_PARAVIEW_APP_COMPO_LIB}
+  ${KERNEL_SALOMELocalTrace} 
+  ${KERNEL_OpUtil} 
+  suit 
+  Event 
+  pqApplicationComponents
   vtkRenderingFreeTypeOpenGL
-)
+  )
 
 # --- headers ---
 
index 4b166ab21e7168d42d6be91d1ad8953dc509472b..8adc8dc2803b1ffa48beb025fbea3d7cd0c6bf8a 100644 (file)
@@ -47,9 +47,6 @@ public:
 
   virtual ~PVViewer_Behaviors() {}
 
-//public slots:
-//  void onEmulateApply();
-
 private:
   static int BehaviorLoadingLevel;
 };
index 7ec6271da795652b25039c991f29f28a06df7b50..e9c8abd8bc5e06893134cd087779ac6a2fe81370 100644 (file)
 #include "PVViewer_EngineWrapper.h"
 #include <Utils_SALOME_Exception.hxx>
 
-//#include <SalomeApp_Application.h>
 #include <SUIT_Session.h>
+#include <PyInterp_Utils.h>
+
+class PVViewer_EngineWrapper::Private
+{
+public:
+  PyObjWrapper pvserverEngine;
+};
 
 PVViewer_EngineWrapper * PVViewer_EngineWrapper::instance = NULL;
 
@@ -33,69 +39,9 @@ PVViewer_EngineWrapper * PVViewer_EngineWrapper::GetInstance()
   return instance;
 }
 
-//static SalomeApp_Application* getApplication()
-//{
-//  if ( SUIT_Session::session() )
-//    return dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
-//  return 0;
-//}
-//
-//PVViewer_EngineWrapper::PVViewer_EngineWrapper()
-//// : pvserverEngine(NULL)
-//{
-//  _component = getApplication()->lcc()->FindOrLoad_Component( "FactoryServer", "PARAVIS" );
-//}
-//
-//bool PVViewer_EngineWrapper::GetGUIConnected()
-//{
-//  CORBA::Request_var req = _component->_request("GetGUIConnected");
-//  req->set_return_type(CORBA::_tc_boolean);
-//  req->invoke();
-//  CORBA::Exception *exc =req->env()->exception();
-//  if( exc )
-//    throw SALOME_Exception("Unable to invoke PARAVIS engine!");
-//  CORBA::Any & ret = req->return_value();
-//  CORBA::Boolean bo;
-//
-//  if (ret >>= bo)
-//    return bool(bo);
-//  else
-//    throw SALOME_Exception("Unable to convert engine result!");
-//}
-//
-//void PVViewer_EngineWrapper::SetGUIConnected(bool isConnected)
-//{
-//  CORBA::Request_var req = _component->_request("SetGUIConnected");
-//  CORBA::Boolean arg = isConnected;
-//  req->add_in_arg() <<= arg;
-//  req->set_return_type(CORBA::_tc_void);
-//  req->invoke();
-//  CORBA::Exception *exc =req->env()->exception();
-//  if( exc )
-//    throw SALOME_Exception("Unable to invoke PARAVIS engine!");
-//}
-//
-//std::string PVViewer_EngineWrapper::FindOrStartPVServer(int port)
-//{
-//  CORBA::Request_var req = _component->_request("FindOrStartPVServer");
-//  CORBA::Long arg = port;
-//  req->add_in_arg() <<= arg;
-//  req->set_return_type(CORBA::_tc_string);
-//  req->invoke();
-//  CORBA::Exception *exc =req->env()->exception();
-//  if( exc )
-//    throw SALOME_Exception("Unable to invoke PARAVIS engine!");
-//
-//  const char* ret;
-//  if(req->return_value() >>= ret)
-//    return std::string(ret);
-//  else
-//    throw SALOME_Exception("Unable to convert engine result!");
-//}
-
-PVViewer_EngineWrapper::PVViewer_EngineWrapper() :
-    pvserverEngine(NULL)
+PVViewer_EngineWrapper::PVViewer_EngineWrapper()
 {
+  myData = new Private;
   PyLockWrapper lock;
   const char* code = "import PVSERVER_utils as pa;__enginePVSERVER=pa.getEngine()";
   int ret = PyRun_SimpleString(const_cast<char*>(code));
@@ -107,15 +53,18 @@ PVViewer_EngineWrapper::PVViewer_EngineWrapper() :
   PyObject* main_module = PyImport_AddModule((char*)"__main__");
   PyObject* global_dict = PyModule_GetDict(main_module);
   PyObjWrapper tmp(PyDict_GetItemString(global_dict, "__enginePVSERVER"));
-  pvserverEngine = tmp;
+  myData->pvserverEngine = tmp;
 }
 
-
+PVViewer_EngineWrapper::~PVViewer_EngineWrapper()
+{
+  delete myData;
+}
 
 bool PVViewer_EngineWrapper::GetGUIConnected()
 {
   PyLockWrapper lock;
-  PyObjWrapper obj(PyObject_CallMethod(pvserverEngine, (char*)("GetGUIConnected"), NULL));
+  PyObjWrapper obj(PyObject_CallMethod(myData->pvserverEngine, (char*)("GetGUIConnected"), NULL));
   if (!obj)
     {
       PyErr_Print();
@@ -128,7 +77,7 @@ void PVViewer_EngineWrapper::SetGUIConnected(bool isConnected)
 {
   PyLockWrapper lock;
 
-  PyObjWrapper obj(PyObject_CallMethod(pvserverEngine, (char*)("SetGUIConnected"),
+  PyObjWrapper obj(PyObject_CallMethod(myData->pvserverEngine, (char*)("SetGUIConnected"),
                                        (char *)"i", (int)isConnected ) );
   if (!obj)
     {
@@ -140,7 +89,7 @@ void PVViewer_EngineWrapper::SetGUIConnected(bool isConnected)
 std::string PVViewer_EngineWrapper::FindOrStartPVServer(int port)
 {
   PyLockWrapper lock;
-  PyObjWrapper obj(PyObject_CallMethod(pvserverEngine, (char*)("FindOrStartPVServer"),
+  PyObjWrapper obj(PyObject_CallMethod(myData->pvserverEngine, (char*)("FindOrStartPVServer"),
                                          (char *)"i", port ) );
   if (!obj)
     {
@@ -155,7 +104,7 @@ std::string PVViewer_EngineWrapper::FindOrStartPVServer(int port)
 void PVViewer_EngineWrapper::PutPythonTraceStringToEngine(const char * str)
 {
   PyLockWrapper lock;
-  PyObjWrapper obj(PyObject_CallMethod(pvserverEngine, (char*)("PutPythonTraceStringToEngine"),
+  PyObjWrapper obj(PyObject_CallMethod(myData->pvserverEngine, (char*)("PutPythonTraceStringToEngine"),
                                        (char *)"s",  str) );
   if (!obj)
     {
index 3581634307466a1f5f399a341176df3641dcfa7e..6ce74f2fdc341c0d856b2925605da80f5a61b0fd 100644 (file)
 
 #include "PVViewer.h"
 
-#include <PyInterp_Utils.h>
 #include <string>
 
-//#include <SALOMEconfig.h>
-//#include <SALOME_LifeCycleCORBA.hxx>
-//#include <SALOMEDS_SObject.hxx>
-//#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
-//#include CORBA_SERVER_HEADER(SALOMEDS)
-
-
 /*!
  * Class facilitating the access to the PARAVIS engine without having to link
  * to it. Documentation of the method is found in the PARAVIS module (in the idl directory).
- *
- * (Two implementations are provided: one with CORBA dynamic invokation from C++, one using
- * Python - see commented elements in the .cxx file)
  */
 class PVVIEWER_EXPORT PVViewer_EngineWrapper
 {
+  class Private;
 public:
   //! Returns the unique instance of the engine.
-  static PVViewer_EngineWrapper * GetInstance();
+  static PVViewer_EngineWrapper* GetInstance();
 
   bool GetGUIConnected();
   void SetGUIConnected(bool isConnected);
   std::string FindOrStartPVServer(int port);
-  void PutPythonTraceStringToEngine(const char *);
+  void PutPythonTraceStringToEngine(const char*);
 
 private:
   PVViewer_EngineWrapper();
-  virtual ~PVViewer_EngineWrapper() {}
-
-  static PVViewer_EngineWrapper * instance;
-  //Engines::EngineComponent_var _component;
+  virtual ~PVViewer_EngineWrapper();
 
-  PyObjWrapper pvserverEngine;
+  static PVViewer_EngineWrapper* instance;
+  Private* myData;
 };
 
 #endif /* PVVIEWERENGINEWRAPPER_H_ */
index fc3801103696ac564e81363f818b2919bd3f37d8..ac4fa9c4a2276d191546018ad13c2c7c3ea0dfd8 100644 (file)
@@ -28,8 +28,6 @@
 
 vtkStandardNewMacro(PVViewer_LogWindowAdapter);
 
-
-
 /*!
  * Put the message in the log window. 
  */
@@ -86,15 +84,6 @@ const unsigned int PVViewer_LogWindowAdapter::getGenericWarningCount()
   return this->GenericWarningCount;
 }
 
-//LogWindow* PVViewer_LogWindowAdapter::getLogWindow()
-//{
-//  LogWindow* wnd = 0;
-//  LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
-//  if ( anApp )
-//    wnd = anApp->logWindow();
-//  return wnd;
-//}
-
 void PVViewer_LogWindowAdapter::DisplayText(const char* text)
 {
   ++this->TextCount;
index 0e5ed865649b12de8b18cda659add071d3db77a6..74832ce2a66b84acb801948c13de5aa7095346cd 100644 (file)
@@ -30,9 +30,6 @@
 #include <SUIT_Session.h>
 #include <SUIT_Study.h>
 #include <SUIT_ResourceMgr.h>
-#include <PyInterp_Interp.h>
-#include <PyConsole_Interp.h>
-#include <PyConsole_Console.h>
 #include <LogWindow.h>
 
 #include <QApplication>
@@ -72,7 +69,6 @@ PVViewer_ViewManager::PVViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* des
 
   connect( desk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
            this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
-//  connect(this, SIGNAL(viewCreated(SUIT_ViewWindow*)), this, SLOT(onPVViewCreated(SUIT_ViewWindow*)));
 }
 
 pqPVApplicationCore * PVViewer_ViewManager::GetPVApplication()
index 3778b5f6e9756534a44f940bd4a928db1359d00d..764284255e660a770a1fab05c2f05ee88fb7e68f 100644 (file)
@@ -30,7 +30,6 @@ PVViewer_Viewer::PVViewer_Viewer()
   MESSAGE("PVViewer_Viewer: creating view model ...");
 }
 
-
 /*!
   Create new instance of view window on desktop \a theDesktop.
   \retval SUIT_ViewWindow* - created view window pointer.
index 7a3e6b3f90635a37b051f1b47d896d0e5116ee1d..b55001ef62e49ccb745a5569d513393cb40cbe65 100755 (executable)
@@ -64,7 +64,6 @@ SET(_other_SOURCES
   PyInterp_Event.cxx
   PyInterp_Interp.cxx
   PyInterp_Request.cxx
-  PyInterp_Utils.cxx
 )
 
 # sources / to compile
diff --git a/src/PyInterp/PyInterp_Utils.cxx b/src/PyInterp/PyInterp_Utils.cxx
deleted file mode 100644 (file)
index 6c54581..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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, or (at your option) any later version.
-//
-// 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
-//
-//  Author : Adrien BRUNETON
-//
-
-#include "PyInterp_Utils.h"
-
-#include <iostream>
-
-/*!
-  \class PyLockWrapper
-  \brief Python GIL wrapper.
-*/
-
-/*!
-  \brief Constructor. Automatically acquires GIL.
-*/
-PyLockWrapper::PyLockWrapper()
-{
-  _gil_state = PyGILState_Ensure();
-  // Save current thread state for later comparison
-  _state = PyGILState_GetThisThreadState();
-}
-
-/*!
-  \brief Destructor. Automatically releases GIL.
-*/
-PyLockWrapper::~PyLockWrapper()
-{
-  PyThreadState * _currState = PyGILState_GetThisThreadState();
-  if (_currState != _state)
-    {
-      std::cout << "!!!!!!!!! PyLockWrapper inconsistency - now entering infinite loop for debugging\n";
-      while(1);
-    }
-
-  PyGILState_Release(_gil_state);
-}
-
index d6f6e6f835f1aa7e7f34303250cc721f209682e7..31bbd9f15f791264d455d1da410f38db41744cfe 100644 (file)
 
 #include "PyInterp.h"
 #include <Python.h>
+#ifdef _DEBUG_
+  #include <iostream>
+#endif
 
 /**
+ * \class PyLockWrapper
+ * \brief Python GIL wrapper.
+ *
  * Utility class wrapping the Python GIL acquisition. This makes use of the high level
  * API (PyGILState_Ensure and PyGILState_Release), and is hence compatible with only
  * one running Python interpreter (no call to Py_NewInterpreter()).
@@ -39,12 +45,35 @@ class PYINTERP_EXPORT PyLockWrapper
 {
 
 public:
-  PyLockWrapper();
-  ~PyLockWrapper();
+  /**
+   * \brief Constructor. Automatically acquires GIL.
+   */
+  PyLockWrapper()
+  {
+    _gil_state = PyGILState_Ensure();
+    // Save current thread state for later comparison
+    _state = PyGILState_GetThisThreadState();
+  }
+
+  /**
+   * \brief Destructor. Automatically releases GIL.
+   */
+  ~PyLockWrapper()
+  {
+    PyThreadState* _currState = PyGILState_GetThisThreadState();
+#ifdef _DEBUG_
+    if (_currState != _state)
+    {
+      std::cout << "!!!!!!!!! PyLockWrapper inconsistency - now entering infinite loop for debugging\n";
+      while(1);
+    }
+#endif
+    PyGILState_Release(_gil_state);
+  }
 
 private:
   PyGILState_STATE _gil_state;
-  PyThreadState * _state;
+  PyThreadState* _state;
 
   // "Rule of 3" - Forbid usage of copy operator and copy-constructor
   PyLockWrapper(const PyLockWrapper & another);
@@ -53,7 +82,8 @@ private:
 
 
 /**
- * Utility class to properly handle the reference counting required on Python objects.
+ * \class PyObjWrapper
+ * \brief Utility class to properly handle the reference counting required on Python objects.
  */
 class PYINTERP_EXPORT PyObjWrapper
 {
index 69f99a0140f0587260e8bd9586344fdae9a7e7c8..4f7796dbbaab0b95aa70e73b281fb7b13acd825b 100755 (executable)
@@ -34,9 +34,14 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/OBJECT
   ${PROJECT_SOURCE_DIR}/src/Prs
   ${PROJECT_SOURCE_DIR}/src/VTKViewer
-  ${PROJECT_SOURCE_DIR}/src/OpenGLUtils
 )
 
+IF(SALOME_USE_GLVIEWER)
+  INCLUDE_DIRECTORIES(
+    ${PROJECT_SOURCE_DIR}/src/OpenGLUtils
+    )
+ENDIF()
+
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS})
 
@@ -47,9 +52,15 @@ SET(_link_LIBRARIES
   ${VTK_LIBRARIES} 
   ${CAS_KERNEL} ${CAS_VIEWER}
   ${KERNEL_OpUtil}
-  qtx suit ViewerTools SalomeObject SalomePrs VTKViewer OpenGLUtils
+  qtx suit ViewerTools SalomeObject SalomePrs VTKViewer
 )
 
+IF(SALOME_USE_GLVIEWER)
+  LIST(APPEND _link_LIBRARIES 
+    OpenGLUtils
+    )
+ENDIF()
+
 # --- headers ---
 
 # header files / to be processed by moc
index 26e548d381bfe9dacae0476533d4040bb2fb7f78..f8fc7c41d2acf99b33fd834f0b4761668d491586 100755 (executable)
 #include "VTKViewer_Algorithm.h"
 #include "SVTK_Functor.h"
 
-#include <OpenGLUtils_FrameBuffer.h>
+#ifndef DISABLE_GLVIEWER
+  #include <OpenGLUtils_FrameBuffer.h>
+#endif
 
 
 namespace SVTK
@@ -1169,6 +1171,7 @@ QImage SVTK_ViewWindow::dumpViewContent()
   int aWidth = aSize[0];
   int aHeight = aSize[1];
   
+#ifndef DISABLE_GLVIEWER
   OpenGLUtils_FrameBuffer aFrameBuffer;
   if( aFrameBuffer.init( aWidth, aHeight ) )
   {
@@ -1192,6 +1195,7 @@ QImage SVTK_ViewWindow::dumpViewContent()
     anImage = anImage.mirrored();
     return anImage;
   }
+#endif
 
   // if frame buffers are unsupported, use old functionality
   unsigned char *aData = 
index 95465cd4dc788db4b39384b56ba6fc96999931a8..d661e5e7d768efb1ee27d119fff95d97a43b0872 100644 (file)
@@ -801,10 +801,12 @@ void SalomeApp_Application::updateCommandsStatus()
   if ( a )
     a->setEnabled( activeStudy() );
 
+#ifndef DISABLE_PYCONSOLE
   // Load script menu
   a = action( LoadScriptId );
   if( a )
     a->setEnabled( pythonConsole() );
+#endif
 
   // Properties menu
   a = action( PropertiesId );