]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Debug of CMake build procedure
authormpa <mpa@opencascade.com>
Thu, 27 Feb 2014 11:43:42 +0000 (15:43 +0400)
committermpa <mpa@opencascade.com>
Thu, 27 Feb 2014 11:43:42 +0000 (15:43 +0400)
32 files changed:
CMakeLists.txt
SalomeGUIConfig.cmake.in
adm_local/cmake_files/FindSalomeGUI.cmake
src/CMakeLists.txt
src/LightApp/CMakeLists.txt
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_FullScreenHelper.cxx
src/LightApp/LightApp_Module.cxx
src/LightApp/LightApp_Plot2dSelector.cxx
src/LightApp/LightApp_SelectionMgr.cxx
src/LightApp/LightApp_SelectionMgr.h
src/LightApp/LightApp_ShowHideOp.cxx
src/Plot2d/CMakeLists.txt
src/Plot2d/Plot2d_ViewFrame.cxx
src/Plot2d/Plot2d_ViewWindow.cxx
src/SALOME_PYQT/CMakeLists.txt
src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt
src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx
src/SALOME_PYQT/SalomePyQt/CMakeLists.txt
src/SALOME_SWIG/CMakeLists.txt
src/SALOME_SWIG/SALOMEGUI_Swig.cxx
src/SUITApp/CMakeLists.txt
src/SUITApp/SUITApp.cxx
src/SalomeApp/CMakeLists.txt
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/SalomeApp_DoubleSpinBox.cxx
src/SalomeApp/SalomeApp_IntSpinBox.cxx
src/SalomeApp/SalomeApp_Study.cxx
src/SalomeApp/SalomeApp_Study.h
tools/CMakeLists.txt

index 14be7b0beda0f7f4e52519d3e303756f50efd814..b82a29a2454b58f1f7e7860d1ea95f6369cd0ad3 100755 (executable)
@@ -17,6 +17,8 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
+INCLUDE(CMakeDependentOption)
+
 PROJECT(SalomeGUI C CXX)
 
 # Ensure a proper linker behavior:
@@ -62,16 +64,19 @@ OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
 OPTION(SALOME_GUI_USE_OBSERVERS "Use study observers in GUI (advanced)" ON)
 
 # Advanced options:
+CMAKE_DEPENDENT_OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF
+                       "NOT SALOME_KERNEL_LIGHT_ONLY" ON)
 OPTION(SALOME_USE_VTKVIEWER "Enable VTK visualization (Mandatory in classic configurations)" ON)
-OPTION(SALOME_USE_SALOMEOBJECT "Enable Salome Object (Mandatory in classic configurations)" ON)
 OPTION(SALOME_USE_OCCVIEWER "Enable OCC visualization (Mandatory in classic configurations)" ON)
 OPTION(SALOME_USE_GLVIEWER "Enable OpenGL visualization (Mandatory in classic configurations)" ON)
 OPTION(SALOME_USE_GRAPHICSVIEW "Enable GraphicsView visualization (Mandatory in classic configurations)" ON)
 OPTION(SALOME_USE_PLOT2DVIEWER "Enable Plot2D visualization (Mandatory in classic configurations)" ON)
 OPTION(SALOME_USE_PYCONSOLE "Enable Python GUI interface (Mandatory in classic configurations)" ON)
 OPTION(SALOME_USE_QXGRAPHVIEWER "Enable QX graph visualization (Mandatory in classic configurations)" ON)
+CMAKE_DEPENDENT_OPTION(SALOME_USE_SALOMEOBJECT "Enable Salome Object (Mandatory in classic configurations)" ON
+                       "SALOME_LIGHT_ONLY" ON)
 
-MARK_AS_ADVANCED(SALOME_USE_VTKVIEWER SALOME_USE_VTKVIEWER SALOME_USE_GRAPHICSVIEW)
+MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_VTKVIEWER SALOME_USE_GRAPHICSVIEW)
 MARK_AS_ADVANCED(SALOME_USE_SALOMEOBJECT SALOME_USE_OCCVIEWER SALOME_USE_GLVIEWER SALOME_USE_PLOT2DVIEWER)
 MARK_AS_ADVANCED(SALOME_USE_PYCONSOLE SALOME_USE_QXGRAPHVIEWER)
 
@@ -96,6 +101,8 @@ FIND_PACKAGE(SalomeHDF5 REQUIRED COMPONENTS C)
 IF(NOT SALOME_LIGHT_ONLY)
   FIND_PACKAGE(SalomeOmniORB REQUIRED)
   FIND_PACKAGE(SalomeOmniORBPy REQUIRED)
+ELSE()
+  ADD_DEFINITIONS("-DGUI_DISABLE_CORBA")
 ENDIF() 
 IF(SALOME_BUILD_TESTS)
   ENABLE_TESTING()
@@ -124,6 +131,9 @@ ENDIF()
 
 # OCCT
 FIND_PACKAGE(SalomeCAS REQUIRED)
+IF(NOT SALOME_USE_OCCVIEWER)
+  ADD_DEFINITIONS("-DDISABLE_OCCVIEWER")
+ENDIF()
 
 # Qt4
 FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL)
@@ -135,15 +145,36 @@ FIND_PACKAGE(SalomePyQt4 REQUIRED)
 IF(SALOME_USE_GLVIEWER)
   FIND_PACKAGE(SalomeOpenGL)
   SALOME_LOG_OPTIONAL_PACKAGE(OpenGL SALOME_USE_GLVIEWER) 
+ELSE()
+  ADD_DEFINITIONS("-DDISABLE_GLVIEWER")
 ENDIF()
 IF(SALOME_USE_VTKVIEWER)
   # Required components are listed in the FindSalomeVTK.cmake file: 
   FIND_PACKAGE(SalomeVTK 6.0) 
   SALOME_LOG_OPTIONAL_PACKAGE(VTK SALOME_USE_VTKVIEWER)
+ELSE()
+  ADD_DEFINITIONS("-DDISABLE_VTKVIEWER")
 ENDIF()
 IF(SALOME_USE_PLOT2DVIEWER)
   FIND_PACKAGE(SalomeQwt)  
   SALOME_LOG_OPTIONAL_PACKAGE(Qwt SALOME_USE_PLOT2DVIEWER)
+ELSE()
+  ADD_DEFINITIONS("-DDISABLE_PLOT2DVIEWER")
+ENDIF()
+IF (NOT SALOME_USE_GRAPHICSVIEW)
+  ADD_DEFINITIONS("-DDISABLE_GRAPHICSVIEW")
+ENDIF()
+IF(SALOME_USE_PYCONSOLE)
+  # Build with obsolete Python module's methods
+  ADD_DEFINITIONS(-DCALL_OLD_METHODS)
+ELSE()
+  ADD_DEFINITIONS("-DDISABLE_PYCONSOLE")
+ENDIF()
+IF(NOT SALOME_USE_QXGRAPHVIEWER)
+  ADD_DEFINITIONS("-DDISABLE_QXGRAPHVIEWER")
+ENDIF()
+IF(NOT SALOME_USE_SALOMEOBJECT)
+  ADD_DEFINITIONS("-DDISABLE_SALOMEOBJECT")
 ENDIF()
 
 # Detection summary:
@@ -227,8 +258,8 @@ INCLUDE(CMakePackageConfigHelpers)
 # 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
-    QDS qtx SalomeIDLGUI SalomePrs SalomeStyle std SUITApp suit ViewerTools ViewerData
-    vtkTools vtkEDFOverloads ImageComposer
+    QDS qtx SalomePrs SalomeStyle std SUITApp suit ViewerTools ViewerData
+    ImageComposer
 )
 
 # SALOME object specific targets:
@@ -246,7 +277,7 @@ ENDIF(SALOME_USE_GLVIEWER)
 # VTK specific targets:
 IF(SALOME_USE_VTKVIEWER)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets 
-       VTKViewer)
+       VTKViewer vtkTools vtkEDFOverloads)
   IF(SALOME_USE_SALOMEOBJECT)
     LIST(APPEND _${PROJECT_NAME}_exposed_targets 
          SVTK)
@@ -288,13 +319,22 @@ ENDIF(SALOME_USE_GRAPHICSVIEW)
 # Python-based packages specific targets:
 IF(SALOME_USE_PYCONSOLE)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets 
-       PyInterp PyConsole SalomePy SalomePyQtGUI SalomePyQtGUILight SalomePyQt)
+       PyInterp PyConsole  SalomePyQtGUILight)
+  IF(SALOME_USE_PLOT2DVIEWER)
+    LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomePyQt)
+  ENDIF()
+  IF(NOT SALOME_LIGHT_ONLY)
+    LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomePyQtGUI)
+  ENDIF()
+  IF(SALOME_USE_VTKVIEWER)
+    LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomePy)
+  ENDIF(SALOME_USE_VTKVIEWER)
 ENDIF(SALOME_USE_PYCONSOLE)
 
 # CORBA specific targets:
 IF(NOT SALOME_LIGHT_ONLY)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets
-       SalomeSession SalomeApp SalomeGuiHelpers SalomeTreeData ToolsGUI)
+       SalomeIDLGUI SalomeSession SalomeApp SalomeGuiHelpers SalomeTreeData ToolsGUI)
 ENDIF(NOT SALOME_LIGHT_ONLY)
 
 # Add all targets to the build-tree export set
index 2d1c2ef3a276d7106bdda4eb30f91745327e228c..b658ac406a04c42f3144c1290a8e78a1bf79b170 100644 (file)
@@ -49,13 +49,18 @@ SET(GUI_DEFINITIONS "@KERNEL_DEFINITIONS@")
 # Options exported by the package:
 SET(SALOME_GUI_BUILD_DOC    @SALOME_BUILD_DOC@)
 SET(SALOME_GUI_BUILD_TESTS  @SALOME_BUILD_TESTS@)
-SET(SALOME_LIGHT_ONLY       @SALOME_LIGHT_ONLY@)
+SET(SALOME_GUI_LIGHT_ONLY   @SALOME_LIGHT_ONLY@)
 
 # Advanced options
-SET(SALOME_USE_OCCVIEWER    @SALOME_USE_OCCVIEWER@)
-SET(SALOME_USE_GLVIEWER     @SALOME_USE_GLVIEWER@)
-SET(SALOME_USE_VTKVIEWER    @SALOME_USE_VTKVIEWER@)
-SET(SALOME_USE_PLOT2DVIEWER @SALOME_USE_PLOT2DVIEWER@)
+SET(SALOME_USE_OCCVIEWER     @SALOME_USE_OCCVIEWER@)
+SET(SALOME_USE_GLVIEWER      @SALOME_USE_GLVIEWER@)
+SET(SALOME_USE_VTKVIEWER     @SALOME_USE_VTKVIEWER@)
+SET(SALOME_USE_PLOT2DVIEWER  @SALOME_USE_PLOT2DVIEWER@)
+SET(SALOME_USE_GRAPHICSVIEW  @SALOME_USE_GRAPHICSVIEW@)
+SET(SALOME_USE_QXGRAPHVIEWER @SALOME_USE_QXGRAPHVIEWER@)
+
+SET(SALOME_USE_PYCONSOLE     @SALOME_USE_PYCONSOLE@)
+SET(SALOME_USE_SALOMEOBJECT  @SALOME_USE_SALOMEOBJECT@)
 
 # Level 1 prerequisites:
 SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@")
index f8a4253674ce4175a3f6d50c0249bbbfdfcfd9c0..90e66d9e278446881f48ea271d0ae3281f8b5472 100644 (file)
@@ -39,4 +39,45 @@ ENDIF()
 
 FOREACH(_res ${SalomeGUI_EXTRA_ENV})
   SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeGUI_EXTRA_ENV_${_res}}")
-ENDFOREACH()
\ No newline at end of file
+ENDFOREACH()
+
+#----------------------------------------------------------------------------
+# FULL_GUI is a macro useful for determining whether a GUI module 
+# builded in full mode 
+#----------------------------------------------------------------------------
+#########################################################################
+# FULL_GUI()
+# 
+# USAGE: FULL_GUI(with_corba)
+#
+# ARGUMENTS:
+#   with_corba [input] TRUE or FALSE - use CORBA for building module or no.
+#
+MACRO(FULL_GUI with_corba)
+  SET(_options)
+  IF(${with_corba} AND ${SALOME_GUI_LIGHT_ONLY})
+    SET(_corba_message "We absolutely need a Salome GUI module with CORBA.\nPlease set option SALOME_LIGHT_ONLY to OFF when building GUI module.")
+  ENDIF() 
+  
+  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)
+              
+  SET(_message) 
+  FOREACH(_option ${_options}) 
+    IF(NOT ${_option})
+      LIST(APPEND _message ${_option})
+    ENDIF()
+  ENDFOREACH()
+  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() 
+  
+ENDMACRO(FULL_GUI)
index 41937f6e9ae9ced94ead0657398db0315ee679ac..fc55f70e95917484265610f5f9da40e9a23ed8b1 100755 (executable)
@@ -90,7 +90,13 @@ ENDIF(SALOME_USE_GRAPHICSVIEW)
 ##
 IF(SALOME_USE_PYCONSOLE) 
   SET(SUBDIRS_PYCONSOLE PyInterp PyConsole)
-  SET(SUBDIRS_PYTHON SALOME_SWIG SALOME_PY SALOME_PYQT)
+  SET(SUBDIRS_PYTHON SALOME_PYQT)
+  IF(SALOME_USE_VTKVIEWER)
+    LIST(APPEND SUBDIRS_PYTHON SALOME_PY)
+  ENDIF()
+  IF(SALOME_USE_SALOMEOBJECT)
+    LIST(APPEND SUBDIRS_PYTHON SALOME_SWIG)
+  ENDIF()
 ENDIF(SALOME_USE_PYCONSOLE)
 
 ##
index fb98cbbe44d1ef2993fe02c94eeee1f1657ca7de..736648da946ae33c7d81eea09cb706ea6acff418 100755 (executable)
@@ -82,36 +82,11 @@ ENDIF()
 
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${HDF5_DEFINITIONS})
-IF(NOT WIN32)
-  ADD_DEFINITIONS("-Wno-deprecated")
-ENDIF()
-IF(NOT SALOME_USE_SALOMEOBJECT)
-  ADD_DEFINITIONS("-DDISABLE_SALOMEOBJECT")
-ENDIF()
-IF (NOT SALOME_USE_GLVIEWER)
-  ADD_DEFINITIONS("-DDISABLE_GLVIEWER")
-ENDIF()
-IF (NOT SALOME_USE_GRAPHICSVIEW)
-  ADD_DEFINITIONS("-DDISABLE_GRAPHICSVIEW")
-ENDIF()
-IF(NOT SALOME_USE_OCCVIEWER)
-  ADD_DEFINITIONS("-DDISABLE_OCCVIEWER")
-ENDIF()
 IF(SALOME_USE_PLOT2DVIEWER)
   ADD_DEFINITIONS(${QWT_DEFINITIONS})
-ELSE()
-  ADD_DEFINITIONS("-DDISABLE_PLOT2DVIEWER")
-ENDIF()
-IF(NOT SALOME_USE_VTKVIEWER)
-  ADD_DEFINITIONS("-DDISABLE_VTKVIEWER")
-ENDIF()
-IF(NOT SALOME_USE_QXGRAPHVIEWER)
-  ADD_DEFINITIONS("-DDISABLE_QXGRAPHVIEWER")
 ENDIF()
 IF(SALOME_USE_PYCONSOLE)
   ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
-ELSE()
-  ADD_DEFINITIONS("-DDISABLE_PYCONSOLE")
 ENDIF()
 
 # libraries to link to
index 6a5063951df275adac61a23d78858b0f0c054a58..e6970b23f1ab05c57bb867e79a67664ae00294f8 100644 (file)
@@ -42,6 +42,7 @@
 #include "LightApp_Application.h"
 #include "LightApp_Module.h"
 #include "LightApp_DataModel.h"
+#include "LightApp_DataOwner.h"
 #include "LightApp_Study.h"
 #include "LightApp_Preferences.h"
 #include "LightApp_PreferencesDlg.h"
@@ -2206,6 +2207,9 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   // ... "Trihedron" group <<end>>
   // .. "3D viewer" group <<end>>
 
+  QString formats;
+  int bgId;
+#ifndef DISABLE_OCCVIEWER
   // .. "OCC viewer" group <<start>>
   int occGroup = pref->addPreference( tr( "PREF_GROUP_OCCVIEWER" ), salomeCat );
 
@@ -2215,10 +2219,10 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   aValuesList.clear();
   anIndicesList.clear();
   txtList.clear();
-  QString formats = OCCViewer_Viewer::backgroundData( aValuesList, idList, txtList );
+  formats = OCCViewer_Viewer::backgroundData( aValuesList, idList, txtList );
   foreach( int gid, idList ) anIndicesList << gid;
   // .... -> 3D viewer background
-  int bgId = pref->addPreference( tr( "PREF_3DVIEWER_BACKGROUND" ), bgGroup,
+  bgId = pref->addPreference( tr( "PREF_3DVIEWER_BACKGROUND" ), bgGroup,
                                   LightApp_Preferences::Background, "OCCViewer", "background" );
   pref->setItemProperty( "gradient_names", aValuesList, bgId );
   pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
@@ -2281,7 +2285,9 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemProperty( "columns", 2, occGen );
   // ... -> empty frame (for layout) <<end>>
   // .. "OCC viewer" group <<end>>
+#endif
 
+#ifndef DISABLE_VTKVIEWER
   // .. "VTK viewer" group <<start>>
   int vtkGroup = pref->addPreference( tr( "PREF_GROUP_VTKVIEWER" ), salomeCat ); //viewTab
 
@@ -2301,7 +2307,9 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   aValuesList.clear();
   anIndicesList.clear();
   txtList.clear();
+#ifndef DISABLE_SALOMEOBJECT
   formats = SVTK_Viewer::backgroundData( aValuesList, idList, txtList );
+#endif
   foreach( int gid, idList ) anIndicesList << gid;
   bgId = pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGen,
                               LightApp_Preferences::Background, "VTKViewer", "background" );
@@ -2312,7 +2320,9 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
   pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
   pref->setItemProperty( "custom_enabled", false, bgId );
+#ifndef DISABLE_SALOMEOBJECT
   pref->setItemProperty( "image_formats", formats, bgId );
+#endif
   // .... -> speed increment
   int vtkSpeed = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED" ), vtkGen,
                                       LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" );
@@ -2418,6 +2428,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemProperty( "step", 0.1, transPref );
   // ... -> group names sub-group <<end>>
   // .. "VTK viewer" group <<end>>
+#endif
 
   // .. "Plot2d viewer" group <<start>>
   int plot2dGroup = pref->addPreference( tr( "PREF_GROUP_PLOT2DVIEWER" ), salomeCat ); //viewTab
@@ -3478,6 +3489,7 @@ void LightApp_Application::contextMenuPopup( const QString& type, QMenu* thePopu
       a->setShortcut( ob->shortcutKey(SUIT_DataBrowser::UpdateShortcut) );
   }
 
+#ifndef DISABLE_SALOMEOBJECT
   if ( selMgr && ob ) {
     SALOME_ListIO selected;
     selMgr->selectedObjects( selected );
@@ -3496,6 +3508,7 @@ void LightApp_Application::contextMenuPopup( const QString& type, QMenu* thePopu
       }
     }
   }
+#endif
 
   selMgr->setSelectionCacheEnabled( cacheIsOn );
 }
index 8d5e738750492827d66c3cd7bdcba3beaca306c8..61b72ad638993c11c35b74255063c4591a549ff5 100644 (file)
@@ -28,8 +28,6 @@
 #include <QMenuBar>
 #include <QStatusBar>
 
-#include <PyConsole_Console.h>
-
 #include <STD_Application.h>
 
 #include <SUIT_Session.h>
index 569a13d4dabcbc319e7975990c1b009cf43bc56d..41e803fabbc0aa2c230f761f19268a20ceb12ff6 100644 (file)
@@ -92,6 +92,7 @@
 #include <QVariant>
 #include <QString>
 #include <QStringList>
+#include <QAction>
 
 #include <iostream>
 
index c128219af814ce292cbddd99cb8985980500fc08..27b6edcf38b80f43186a712dee20e2f910c04a88 100755 (executable)
 #include "LightApp_Application.h"
 #include "SUIT_SelectionMgr.h"
 
-#include <SPlot2d_ViewModel.h>
-
-#include <SALOME_ListIO.hxx>
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SALOME_ListIO.hxx>
+  #ifndef DISABLE_PLOT2DVIEWER
+    #include <SPlot2d_ViewModel.h>
+  #endif
+#endif
 
 /*!
   Constructor
@@ -52,21 +55,28 @@ LightApp_Plot2dSelector::~LightApp_Plot2dSelector()
 */
 void LightApp_Plot2dSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
 {
-  if( !myCurEntry.isNull() )
+  if( !myCurEntry.isNull() ) {
+#ifndef DISABLE_SALOMEOBJECT
     theList.append( new LightApp_DataOwner( new SALOME_InteractiveObject(qPrintable(myCurEntry),"","") ) );
+#else
+    theList.append( new LightApp_DataOwner( myCurEntry ) );
+#endif
+  }
 }
 
 /*!Sets selection.*/
 void LightApp_Plot2dSelector::setSelection( const SUIT_DataOwnerPtrList& theList )
 {
+#ifndef DISABLE_SALOMEOBJECT
   SALOME_ListIO anIOList;
   for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin(); it != theList.end(); ++it ) {
     const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*it).operator->() );
     if ( owner  ) {
       if( !owner->IO().IsNull() ) {
-       anIOList.Append(owner->IO());
-      } else if ( !owner->entry().isEmpty() ) {
-       anIOList.Append( new SALOME_InteractiveObject(qPrintable(owner->entry()),"","") );
+           anIOList.Append(owner->IO());
+      }
+      else if ( !owner->entry().isEmpty() ) {
+           anIOList.Append( new SALOME_InteractiveObject(qPrintable(owner->entry()),"","") );
       }      
     }
   }
@@ -74,6 +84,7 @@ void LightApp_Plot2dSelector::setSelection( const SUIT_DataOwnerPtrList& theList
 
   if(v)
     v->setObjectsSelected(anIOList);
+#endif
 }
 
 /*!On selection changed.*/
index 1b833f6d3fe70dc115bd691a50d69a37a5712295..dd304ac1441b84dba589d4f4c59b3549cbcbe971 100644 (file)
@@ -228,6 +228,20 @@ void LightApp_SelectionMgr::selectedObjects( QStringList& theList, const QString
   theList = selList;
 }
 
+/*!
+  Append selected objects.
+*/
+void LightApp_SelectionMgr::setSelectedObjects( const QStringList& lst, const bool append )
+{
+  SUIT_DataOwnerPtrList owners;
+  foreach( const QString& aValue, lst ) {
+    if ( !aValue.isNull() )
+      owners.append( new LightApp_DataOwner( aValue ) );
+  }
+
+  setSelected( owners, append );
+}
+
 #endif
 
 /*!
index daea55bf3239416421942a60f2698bfd153b1714..a3c6a0d01479c78040d88fe5f6238e6e4e1169b6 100644 (file)
@@ -84,6 +84,7 @@ public:
   void                   selectedSubOwners( MapEntryOfMapOfInteger& theMap );
 #else
   void                   selectedObjects( QStringList&, const QString& = QString(), const bool = true ) const;
+  void                   setSelectedObjects( const QStringList&, const bool = false );
 #endif
 
   void                   clearSelectionCache();
index 0c82a4729e127f583a496ea73c20ba131ee8ba88..60828a5841834fe6ccafcd032365aa9ce715ac58 100644 (file)
@@ -143,7 +143,7 @@ void LightApp_ShowHideOp::startOperation()
         entries.append( entry );
     }
 
-  // be sure to use real obejct entries
+  // be sure to use real object entries
   QStringList objEntries;
   QStringList::const_iterator it = entries.begin(), last = entries.end();
   for ( ; it!=last; ++it )
index f634b7d009468614dddf66b81d4d48fa553463d0..352889926befe39ca078b52078c263707a944dcf 100755 (executable)
@@ -25,24 +25,16 @@ INCLUDE(UseQt4Ext)
 INCLUDE_DIRECTORIES(
   ${QT_INCLUDES}
   ${QWT_INCLUDE_DIR}
+  ${PYTHON_INCLUDE_DIRS}
   ${PROJECT_SOURCE_DIR}/src/Qtx
   ${PROJECT_SOURCE_DIR}/src/SUIT
 )
-IF(SALOME_USE_PYCONSOLE)
-  INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
-ENDIF()
 
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(${QT_DEFINITIONS} ${QWT_DEFINITIONS} ${PYTHON_DEFINITIONS})
-IF(SALOME_USE_PYCONSOLE)
-  ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
-ENDIF()
 
 # libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${QWT_LIBRARY} qtx suit)
-IF(SALOME_USE_PYCONSOLE)
-  LIST(APPEND _link_LIBRARIES ${PYTHON_LIBRARIES})
-ENDIF()
+SET(_link_LIBRARIES ${QT_LIBRARIES} ${QWT_LIBRARY} ${PYTHON_LIBRARIES} qtx suit)
 
 # --- headers ---
 
@@ -59,12 +51,8 @@ SET(_moc_HEADERS
   Plot2d_ViewManager.h
   Plot2d_ViewModel.h
   Plot2d_ViewWindow.h
-)
-IF(SALOME_USE_PYCONSOLE)
-  LIST(APPEND _moc_HEADERS
-    Plot2d_AnalyticalCurveDlg.h
+  Plot2d_AnalyticalCurveDlg.h
   )
-ENDIF()
 
 # header files / no moc processing
 SET(_other_HEADERS
@@ -74,13 +62,9 @@ SET(_other_HEADERS
   Plot2d_Object.h
   Plot2d_PlotItems.h
   Plot2d_Prs.h
-)
-IF(SALOME_USE_PYCONSOLE)
-  LIST(APPEND _other_HEADERS
-    Plot2d_AnalyticalCurve.h
-    Plot2d_AnalyticalParser.h
+  Plot2d_AnalyticalCurve.h
+  Plot2d_AnalyticalParser.h
   )
-ENDIF()
 
 # header files / to install
 SET(Plot2d_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
@@ -145,14 +129,10 @@ SET(_other_SOURCES
   Plot2d_ViewManager.cxx
   Plot2d_ViewModel.cxx
   Plot2d_ViewWindow.cxx
-)
-IF(SALOME_USE_PYCONSOLE)
-  LIST(APPEND _other_SOURCES
-    Plot2d_AnalyticalCurve.cxx
-    Plot2d_AnalyticalCurveDlg.cxx
-    Plot2d_AnalyticalParser.cxx
+  Plot2d_AnalyticalCurve.cxx
+  Plot2d_AnalyticalCurveDlg.cxx
+  Plot2d_AnalyticalParser.cxx
   )
-ENDIF()
 
 # sources / to compile
 SET(Plot2d_SOURCES ${_other_SOURCES} ${_moc_SOURCES})
index 262d3c6f0320e36cd9915540c57e77906485e27f..f92e2b2bf75eea0e0059de069b5f38ee1f260ab0 100755 (executable)
@@ -1829,25 +1829,19 @@ void Plot2d_ViewFrame::onSettings()
 */
 void Plot2d_ViewFrame::onAnalyticalCurve()
 {
-#ifndef DISABLE_PYCONSOLE
   Plot2d_AnalyticalCurveDlg dlg( this, this );
   dlg.exec();
   updateAnalyticalCurves();
-#endif
 }
 
 void Plot2d_ViewFrame::addAnalyticalCurve( Plot2d_AnalyticalCurve* theCurve)
 {
-#ifndef DISABLE_PYCONSOLE
-       myAnalyticalCurves.append(theCurve);
-#endif
+  myAnalyticalCurves.append(theCurve);
 }
 
 void Plot2d_ViewFrame::removeAnalyticalCurve( Plot2d_AnalyticalCurve* theCurve)
 {
-#ifndef DISABLE_PYCONSOLE
-       theCurve->setAction(Plot2d_AnalyticalCurve::ActRemoveFromView);
-#endif
+  theCurve->setAction(Plot2d_AnalyticalCurve::ActRemoveFromView);
 }
 
 /*
@@ -1855,7 +1849,6 @@ void Plot2d_ViewFrame::removeAnalyticalCurve( Plot2d_AnalyticalCurve* theCurve)
 */
 void Plot2d_ViewFrame::updateAnalyticalCurve(Plot2d_AnalyticalCurve* c, bool updateView)
 {
-#ifndef DISABLE_PYCONSOLE
   if(!c) return;
   QwtScaleDiv* div = myPlot->axisScaleDiv(QwtPlot::xBottom);
   c->setRangeBegin(div->lowerBound());
@@ -1895,7 +1888,6 @@ void Plot2d_ViewFrame::updateAnalyticalCurve(Plot2d_AnalyticalCurve* c, bool upd
 
   if(updateView)
     myPlot->replot();
-#endif
 }
 
 /*
@@ -1903,13 +1895,11 @@ void Plot2d_ViewFrame::updateAnalyticalCurve(Plot2d_AnalyticalCurve* c, bool upd
 */
 void Plot2d_ViewFrame::updateAnalyticalCurves()
 {
-#ifndef DISABLE_PYCONSOLE
   AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
   for( ; it != myAnalyticalCurves.end(); it++) {
     updateAnalyticalCurve(*it);
   }
   myPlot->replot();
-#endif
 }
 
 /*!
@@ -1924,14 +1914,12 @@ AnalyticalCurveList Plot2d_ViewFrame::getAnalyticalCurves() const
   Get analytical curve by plot item.
 */
 Plot2d_AnalyticalCurve* Plot2d_ViewFrame::getAnalyticalCurve(QwtPlotItem * theItem) {
-#ifndef DISABLE_PYCONSOLE
   AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
   for( ; it != myAnalyticalCurves.end(); it++) {
     if((*it)->plotItem() == theItem);
                return (*it);
   }
   return 0;
-#endif
 }
 #endif
 
index 6cc2ec711fb4f0ef70686529c279238bd41fa104..c222b1660a8af5c1a6e5be021b74a4510773ce5a 100755 (executable)
@@ -433,7 +433,6 @@ void Plot2d_ViewWindow::createActions()
   mgr->registerAction( aAction, CurvSettingsId );
 
   // 9. Analytical curves
-#ifndef DISABLE_PYCONSOLE
   aAction = new QtxAction( tr( "TOT_PLOT2D_ANALYTICAL_CURVES" ),
                            aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ANALYTICAL_CURVES" ) ),
                            tr( "MEN_PLOT2D_ANALYTICAL_CURVES" ),
@@ -442,7 +441,6 @@ void Plot2d_ViewWindow::createActions()
   aAction->setStatusTip( tr( "PRP_PLOT2D_ANALYTICAL_CURVES" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), myViewFrame, SLOT( onAnalyticalCurve() ) );
   mgr->registerAction( aAction, AnalyticalCurveId );
-#endif
 
   // 10. Clone
   aAction = new QtxAction( tr( "MNU_CLONE_VIEW" ),
index d9390716a7abc8e790f0075a84816683860d7161..4affd770e2ebda7ca6678281f6d969d496cc77f5 100755 (executable)
 #
 
 ADD_SUBDIRECTORY(SALOME_PYQT_GUILight)
-ADD_SUBDIRECTORY(SalomePyQt)
 
+IF(SALOME_USE_PLOT2DVIEWER)
+  ADD_SUBDIRECTORY(SalomePyQt)
+ENDIF()
 IF(NOT SALOME_LIGHT_ONLY)
   ADD_SUBDIRECTORY(SALOME_PYQT_GUI)
 ENDIF(NOT SALOME_LIGHT_ONLY)
index 388f14ad629f7bafcb4850bc84f5c7f4eb858222..32d2cb98417a4c6f52983b1b8158ba620a78ad8d 100755 (executable)
@@ -17,7 +17,9 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(${VTK_USE_FILE})
+IF(SALOME_USE_VTKVIEWER)
+  INCLUDE(${VTK_USE_FILE})
+ENDIF()
 
 # --- options ---
 
@@ -42,7 +44,6 @@ INCLUDE_DIRECTORIES(
 
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(
-  "-DCALL_OLD_METHODS"
   ${QT_DEFINITIONS}
   ${CAS_DEFINITIONS} 
   ${PYTHON_DEFINITIONS}
index e28b92ca2608ead408dbb89155acbaf0f9ceb3af..cf8cc6cf720fd3cbf0a3c2583172f8beb685b444 100755 (executable)
@@ -18,7 +18,9 @@
 #
 
 INCLUDE(UsePyQt4)
-INCLUDE(${VTK_USE_FILE})
+IF(SALOME_USE_VTKVIEWER)
+  INCLUDE(${VTK_USE_FILE})
+ENDIF()
 
 # --- options ---
 
@@ -46,14 +48,10 @@ INCLUDE_DIRECTORIES(
 
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(
-  "-DCALL_OLD_METHODS"
   ${QT_DEFINITIONS}
   ${CAS_DEFINITIONS}
   ${PYTHON_DEFINITIONS}
 )
-IF(SALOME_LIGHT_ONLY)
-  ADD_DEFINITIONS("-DGUI_DISABLE_CORBA")
-ENDIF()
 
 # libraries to link to
 SET(_link_LIBRARIES
index 914c5c45a71872e751634b9d255db848ac17a5e4..0a90da4908fddaf8e2ed00303a292f67fb7e2888 100644 (file)
@@ -75,7 +75,7 @@ QMutex myInitMutex;
   etc. is blocked.
 
   CALL_OLD_METHODS macro can be defined, for example, by adding 
-  -DCALL_OLD_METHODS compilation option to the Makefile.
+  -DCALL_OLD_METHODS compilation option to the CMakeLists.txt.
 */
 #ifdef CALL_OLD_METHODS
 const bool IsCallOldMethods = true;
index 58644108892e12e49f18ddc631b10acd2f46e4aa..5a914f487395dee3ae96b8f6311ff992738609cf 100755 (executable)
@@ -18,7 +18,9 @@
 #
 
 INCLUDE(UsePyQt4)
-INCLUDE(${VTK_USE_FILE})
+IF(SALOME_USE_VTKVIEWER)
+  INCLUDE(${VTK_USE_FILE})
+ENDIF()
 
 # --- options ---
 
index 1b71acb258ba0dcf6a421a7a15ae87e8cffbff3c..a4cb8a2941917242f0744401e0f110118858ef1e 100755 (executable)
@@ -18,7 +18,9 @@
 #
 
 INCLUDE(${SWIG_USE_FILE})
-INCLUDE(${VTK_USE_FILE})
+IF(SALOME_USE_VTKVIEWER)
+  INCLUDE(${VTK_USE_FILE})
+ENDIF()
 
 # --- options ---
 
index 313322d66b18ba6684a46567c8f6dc0b7e06bf7b..98d11c99de40a22756d70cbc1e91cc296dcdcdf5 100644 (file)
 #include <LightApp_SelectionMgr.h>
 #include <LightApp_DataOwner.h>
 #include <SALOME_Prs.h>
-#include <SOCC_ViewModel.h>
-#include <SVTK_ViewModel.h>
-#include <SVTK_ViewWindow.h>
-#include <SOCC_ViewWindow.h>
-#include <SPlot2d_ViewWindow.h>
-
 #include <SALOME_Event.h>
-#include <SALOME_ListIO.hxx>
-#include <SALOME_InteractiveObject.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
+
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SALOME_ListIO.hxx>
+  #include <SALOME_InteractiveObject.hxx>
+  #include <SALOME_ListIteratorOfListIO.hxx>
+#ifndef DISABLE_OCCVIEWER
+    #include <SOCC_ViewModel.h>
+    #include <SOCC_ViewWindow.h>
+#endif
+#ifndef DISABLE_VTKVIEWER
+    #include <SVTK_ViewModel.h>
+    #include <SVTK_ViewWindow.h>
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+    #include <SPlot2d_ViewWindow.h>
+#endif
+#endif
+
 
 /*!
   \class SALOMEGUI_Swig
@@ -613,7 +622,7 @@ public:
     if ( LightApp_Application* anApp = getApplication() ) {
       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
       if ( window ) {
-        SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
+        SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getActiveView() );
         if ( view ) {
           SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() );
           myResult = !aPrs->IsNull();
@@ -641,7 +650,7 @@ void SALOMEGUI_Swig::UpdateView()
       if ( LightApp_Application* anApp = getApplication() ) {
         SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
         if ( window ) {
-          SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
+          SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getActiveView() );
           if ( view )
             view->Repaint();
         }
@@ -665,12 +674,20 @@ void SALOMEGUI_Swig::FitAll()
       if ( LightApp_Application* anApp = getApplication() ) {
         SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
         if ( window ) {
+#ifndef DISABLE_SALOMEOBJECT
+#ifndef DISABLE_VTKVIEWER
           if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
             ( dynamic_cast<SVTK_ViewWindow*>( window ) )->onFitAll();
-          else if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )
-            ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )->onFitAll();
-          else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+          if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
             ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )->onFitAll();
+#endif
+#endif
+#ifndef DISABLE_OCCVIEWER
+          if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )
+            ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )->onFitAll();
+#endif
         }
       }
     }
@@ -692,14 +709,22 @@ void SALOMEGUI_Swig::ResetView()
       if ( LightApp_Application* anApp = getApplication() ) {
         SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
         if ( window ) {
+#ifndef DISABLE_SALOMEOBJECT
+#ifndef DISABLE_VTKVIEWER
           if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
             (dynamic_cast<SVTK_ViewWindow*>( window ))->onResetView();
-          else if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )
-            (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onResetView();
-          else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+          if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
             (dynamic_cast<SPlot2d_ViewWindow*>( window ))->onFitAll();
           // VSR: there is no 'ResetView' functionality for Plot2d viewer,
           // so we use 'FitAll' instead.
+#endif
+#endif
+#ifndef DISABLE_OCCVIEWER
+          if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )
+            (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onResetView();
+#endif
         }
       }
     }
@@ -738,6 +763,8 @@ static void setView( int view )
       if ( LightApp_Application* anApp = getApplication() ) {
         SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
         if ( window ) {
+#ifndef DISABLE_SALOMEOBJECT
+#ifndef DISABLE_VTKVIEWER
           if ( dynamic_cast<SVTK_ViewWindow*>( window ) ) {
             switch( myView ) {
             case __ViewTop:
@@ -756,7 +783,10 @@ static void setView( int view )
               break;
             }
           }
-          else if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) ) {
+#endif
+#endif
+#ifndef DISABLE_OCCVIEWER
+          if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) ) {
             switch( myView ) {
             case __ViewTop:
               (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onTopView(); break;
@@ -774,6 +804,7 @@ static void setView( int view )
               break;
             }
           }
+#endif
         }
       }
     }
index dd8e2def01af12f69f6c3957173eabf3c67ec298..1262d614ed1bd6a1d718c864ac901cb1abf75310 100755 (executable)
@@ -34,9 +34,6 @@ INCLUDE_DIRECTORIES(
 
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(${QT_DEFINITIONS} ${PYTHON_DEFINITIONS})
-IF(SALOME_USE_PYCONSOLE)
-  ADD_DEFINITIONS("-DSUIT_ENABLE_PYTHON")
-ENDIF()
 IF(ENABLE_TESTRECORDER)
   ADD_DEFINITIONS("-DENABLE_TESTRECORDER ${TESTRECORDER_DEFINITIONS}")
 ENDIF()
index 3edf1b1601e47ec04d09c75d999ea1d127bbf20b..6d44983e9065be0dc13d8d75871463f6a22bb403 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-//#if defined WIN32
-//#ifdef SUIT_ENABLE_PYTHON
-//#undef SUIT_ENABLE_PYTHON
+//#ifdefined WIN32
+//#ifndef DISABLE_PYCONSOLE
+//#define DISABLE_PYCONSOLE
 //#endif
 //#else //#if defined WIN32
-//#ifndef SUIT_ENABLE_PYTHON
+//#ifdef DISABLE_PYCONSOLE
 // NOTE: DO NOT DELETE THIS DEFINITION ON LINUX
 // or make sure Python is initialized in main() in any case
 // Otherwise, application based on light SALOME and using Python 
 // are unlikely to work properly.
-//#define SUIT_ENABLE_PYTHON
+//#undef DISABLE_PYCONSOLE
 //#include <Python.h>
 //#endif
 //
-#ifdef SUIT_ENABLE_PYTHON
+#ifndef DISABLE_PYCONSOLE
 #include "SUITApp_init_python.hxx"
 #endif
 
@@ -156,7 +156,7 @@ private:
 
 int main( int argc, char* argv[] )
 {
-  //#ifdef SUIT_ENABLE_PYTHON
+  //#ifndef DISABLE_PYCONSOLE
   //  // First of all initialize Python, as in complex multi-component applications
   //  // someone else might initialize it some way unsuitable for light SALOME!
   //  Py_SetProgramName( argv[0] );
@@ -272,7 +272,7 @@ int main( int argc, char* argv[] )
       }
     }
 
-#ifdef SUIT_ENABLE_PYTHON
+#ifndef DISABLE_PYCONSOLE
     //...Initialize python 
     int   _argc   = 1;
     char* _argv[] = {(char*)""};
index fe73b00e76132c312905148798cc03f136e33012..65f278da47b472c99ebc00bcf2c2fa4b248388a5 100755 (executable)
@@ -23,7 +23,9 @@ IF(SALOME_BUILD_TESTS)
 ENDIF()
 
 INCLUDE(UseQt4Ext)
-INCLUDE(${VTK_USE_FILE})
+IF(SALOME_USE_VTKVIEWER)
+  INCLUDE(${VTK_USE_FILE})
+ENDIF()
 
 # --- options ---
 
@@ -33,7 +35,6 @@ INCLUDE_DIRECTORIES(
   ${QT_INCLUDES}
   ${QWT_INCLUDE_DIR}
   ${Boost_INCLUDE_DIRS}
-  ${PYTHON_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${OMNIORB_INCLUDE_DIR}
   ${PROJECT_BINARY_DIR}/idl
@@ -44,8 +45,6 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/OBJECT
   ${PROJECT_SOURCE_DIR}/src/ObjBrowser
   ${PROJECT_SOURCE_DIR}/src/Prs
-  ${PROJECT_SOURCE_DIR}/src/PyConsole
-  ${PROJECT_SOURCE_DIR}/src/PyInterp
   ${PROJECT_SOURCE_DIR}/src/Qtx
   ${PROJECT_SOURCE_DIR}/src/STD
   ${PROJECT_SOURCE_DIR}/src/SUIT
@@ -55,6 +54,14 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/VTKViewer
 )
 
+IF(SALOME_USE_PYCONSOLE)
+  INCLUDE_DIRECTORIES(
+    ${PYTHON_INCLUDE_DIRS}
+    ${PROJECT_SOURCE_DIR}/src/PyConsole
+    ${PROJECT_SOURCE_DIR}/src/PyInterp
+  )
+ENDIF()
+
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(
   ${QT_DEFINITIONS}
@@ -62,20 +69,56 @@ ADD_DEFINITIONS(
   ${QWT_DEFINITIONS}
   ${CAS_DEFINITIONS}
   ${BOOST_DEFINITIONS}
-  ${PYTHON_DEFINITIONS}
 )
 
+IF(SALOME_USE_PYCONSOLE)
+  ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
+ENDIF()
+
 # libraries to link to
 SET(_link_LIBRARIES
   ${CAS_KERNEL}
   ${QT_LIBRARIES}
   ${PYTHON_LIBRARIES}
   ${KERNEL_OpUtil} ${KERNEL_SALOMELocalTrace} ${KERNEL_SalomeDSClient} ${KERNEL_TOOLSDS}
-  CASCatch suit std CAM ObjBrowser SalomePrs PyInterp PyConsole Event
-  GLViewer Plot2d OCCViewer VTKViewer SalomeObject SPlot2d SOCC SVTK
-  LogWindow LightApp SalomePrs ToolsGUI SalomeSession
+  CASCatch suit std CAM ObjBrowser SalomePrs Event
+  LogWindow LightApp SalomePrs ToolsGUI
 )
 
+IF(SALOME_USE_VTKVIEWER)
+  LIST(APPEND _link_LIBRARIES VTKViewer SVTK)
+ENDIF()
+
+IF(SALOME_USE_PYCONSOLE)
+  LIST(APPEND _link_LIBRARIES PyInterp PyConsole)
+ENDIF()
+
+IF(SALOME_USE_GLVIEWER)
+  LIST(APPEND _link_LIBRARIES GLViewer)
+ENDIF()
+
+IF(SALOME_USE_PLOT2DVIEWER)
+  LIST(APPEND _link_LIBRARIES Plot2d)
+  IF(SALOME_USE_SALOMEOBJECT)
+    LIST(APPEND _link_LIBRARIES SPlot2d)
+  ENDIF(SALOME_USE_SALOMEOBJECT)
+ENDIF(SALOME_USE_PLOT2DVIEWER)
+
+IF(SALOME_USE_OCCVIEWER)
+  LIST(APPEND _link_LIBRARIES OCCViewer)
+  IF(SALOME_USE_SALOMEOBJECT)
+    LIST(APPEND _link_LIBRARIES SOCC)
+  ENDIF(SALOME_USE_SALOMEOBJECT)
+ENDIF()
+
+IF(SALOME_USE_SALOMEOBJECT)
+  LIST(APPEND _link_LIBRARIES SalomeObject)
+ENDIF()
+
+IF(NOT SALOME_LIGHT_ONLY)
+  LIST(APPEND _link_LIBRARIES SalomeSession)
+ENDIF()
+
 # --- headers ---
 
 # header files / to be processed by moc
@@ -89,11 +132,14 @@ SET(_moc_HEADERS
   SalomeApp_ListView.h
   SalomeApp_LoadStudiesDlg.h
   SalomeApp_Module.h
-  SalomeApp_NoteBook.h
   SalomeApp_Study.h
   SalomeApp_StudyPropertiesDlg.h
 )
 
+IF(SALOME_USE_PYCONSOLE)
+  LIST(APPEND _moc_HEADERS SalomeApp_NoteBook.h)
+ENDIF()
+
 # header files / no moc processing
 SET(_other_HEADERS
   SalomeApp.h
@@ -102,12 +148,15 @@ SET(_other_HEADERS
   SalomeApp_ExceptionHandler.h
   SalomeApp_Filter.h
   SalomeApp_ImportOperation.h
-  SalomeApp_PyInterp.h
   SalomeApp_Tools.h
   SalomeApp_TypeFilter.h
   SalomeApp_VisualState.h
 )
 
+IF(SALOME_USE_PYCONSOLE)
+  LIST(APPEND _other_HEADERS SalomeApp_PyInterp.h)
+ENDIF()
+
 # header files / to install
 SET(SalomeApp_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
 
@@ -148,8 +197,6 @@ SET(_other_SOURCES
   SalomeApp_ListView.cxx
   SalomeApp_LoadStudiesDlg.cxx
   SalomeApp_Module.cxx
-  SalomeApp_NoteBook.cxx
-  SalomeApp_PyInterp.cxx
   SalomeApp_Study.cxx
   SalomeApp_StudyPropertiesDlg.cxx
   SalomeApp_Tools.cxx
@@ -157,6 +204,10 @@ SET(_other_SOURCES
   SalomeApp_VisualState.cxx
 )
 
+IF(SALOME_USE_PYCONSOLE)
+  LIST(APPEND _other_SOURCES SalomeApp_PyInterp.cxx SalomeApp_NoteBook.cxx)
+ENDIF()
+
 # sources / to compile
 SET(SalomeApp_SOURCES ${_other_SOURCES} ${_moc_SOURCES})
 
index 7e3a64966f8863d51b3c4203ff638c0d2821d12f..3291a9a0884c974a530216696f93dc17bae39da5 100644 (file)
 // Author:    Sergey LITONIN
 
 #ifdef WIN32
-// E.A. : On windows with python 2.6, there is a conflict
-// E.A. : between pymath.h and Standard_math.h which define
-// E.A. : some same symbols : acosh, asinh, ...
-#include <Standard_math.hxx>
-#include <pymath.h>
+  // E.A. : On windows with python 2.6, there is a conflict
+  // E.A. : between pymath.h and Standard_math.h which define
+  // E.A. : some same symbols : acosh, asinh, ...
+  #include <Standard_math.hxx>
+  #ifndef DISABLE_PYCONSOLE
+    #include <pymath.h>
+  #endif
 #endif
 
-#include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
+#ifndef DISABLE_PYCONSOLE
+  #include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
+  #include <PyConsole_Console.h>
+  #include "SalomeApp_NoteBook.h"
+#endif
 #include "SalomeApp_Application.h"
 #include "SalomeApp_Study.h"
 #include "SalomeApp_DataModel.h"
@@ -40,8 +46,6 @@
 #include "SalomeApp_VisualState.h"
 #include "SalomeApp_StudyPropertiesDlg.h"
 #include "SalomeApp_LoadStudiesDlg.h"
-#include "SalomeApp_NoteBook.h"
-
 #include "SalomeApp_ExitDlg.h"
 
 #include <LightApp_Application.h>
@@ -75,7 +79,6 @@
 // temporary commented
 //#include <OB_ListItem.h>
 
-#include <PyConsole_Console.h>
 
 #include <Utils_ORB_INIT.hxx>
 #include <Utils_SINGLETON.hxx>
@@ -238,6 +241,7 @@ void SalomeApp_Application::start()
         updateObjectBrowser(true);
     }
 
+#ifndef DISABLE_PYCONSOLE
     // import/execute python scripts
     if ( pyfiles.count() > 0 && activeStudy() ) {
       SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
@@ -274,6 +278,7 @@ void SalomeApp_Application::start()
         }
       }
     }
+#endif
   } else {
     LightApp_Application::start();
     SALOME_EventFilter::Init();
@@ -368,6 +373,8 @@ void SalomeApp_Application::createActions()
 
   createExtraActions();
 
+#ifndef DISABLE_PYCONSOLE
+#ifndef DISABLE_SALOMEOBJECT
   // import Python module that manages SALOME plugins
   PyGILState_STATE gstate = PyGILState_Ensure();
   PyObjWrapper pluginsmanager = PyImport_ImportModule((char*)"salome_pluginsmanager");
@@ -376,6 +383,8 @@ void SalomeApp_Application::createActions()
     PyErr_Print();
   PyGILState_Release(gstate);
   // end of SALOME plugins loading
+#endif
+#endif
 
 }
 
@@ -476,10 +485,12 @@ void SalomeApp_Application::onNewWithScript()
 
     QString command = QString("execfile(r\"%1\")").arg(aFile);
 
+#ifndef DISABLE_PYCONSOLE
     PyConsole_Console* pyConsole = pythonConsole();
 
     if ( pyConsole )
       pyConsole->exec( command );
+#endif
   }
 }
 
@@ -711,9 +722,11 @@ SUIT_Study* SalomeApp_Application::createNewStudy()
   connect( aStudy, SIGNAL( saved  ( SUIT_Study* ) ), this, SLOT( onStudySaved  ( SUIT_Study* ) ) );
   connect( aStudy, SIGNAL( closed ( SUIT_Study* ) ), this, SLOT( onStudyClosed ( SUIT_Study* ) ) );
 
+#ifndef DISABLE_PYCONSOLE
   //to receive signal in application that NoteBook's variable was modified
   connect( aStudy, SIGNAL(notebookVarUpdated(QString)),
            this, SIGNAL(notebookVarUpdated(QString)) );
+#endif
 
   return aStudy;
 }
@@ -901,10 +914,12 @@ void SalomeApp_Application::onLoadScript( )
   {
     QString command = QString("execfile(r\"%1\")").arg(aFile);
 
+#ifndef DISABLE_PYCONSOLE
     PyConsole_Console* pyConsole = pythonConsole();
 
     if ( pyConsole )
       pyConsole->exec( command );
+#endif
   }
 }
 
@@ -966,7 +981,11 @@ QString SalomeApp_Application::getFileFilter() const
 QWidget* SalomeApp_Application::createWindow( const int flag )
 {
   QWidget* wid = 0;
+#ifndef DISABLE_PYCONSOLE
   if ( flag != WT_PyConsole ) wid = LightApp_Application::createWindow(flag);
+#else
+  wid = LightApp_Application::createWindow(flag);
+#endif
 
   SUIT_ResourceMgr* resMgr = resourceMgr();
 
@@ -1029,6 +1048,7 @@ QWidget* SalomeApp_Application::createWindow( const int flag )
       */
     }
   }
+#ifndef DISABLE_PYCONSOLE
   else if ( flag == WT_PyConsole )
   {
     PyConsole_Console* pyCons = new PyConsole_EnhConsole( desktop(), new SalomeApp_PyInterp() );
@@ -1052,6 +1072,7 @@ QWidget* SalomeApp_Application::createWindow( const int flag )
     }
     wid = getNoteBook();
   }
+#endif
   return wid;
 }
 
@@ -1497,7 +1518,7 @@ SUIT_ViewManager* SalomeApp_Application::newViewManager(const QString& type)
 }
 
 
-/*!Global utility funciton, returns selected GUI Save point object's ID */
+/*!Global utility function, returns selected GUI Save point object's ID */
 int getSelectedSavePoint( const LightApp_SelectionMgr* selMgr )
 {
   SALOME_ListIO aList;
@@ -1543,8 +1564,10 @@ void SalomeApp_Application::onStudyCreated( SUIT_Study* study )
 {
   LightApp_Application::onStudyCreated( study );
 
+#ifndef DISABLE_PYCONSOLE
   desktop()->tabifyDockWidget( windowDock( getWindow( WT_NoteBook ) ),
                                windowDock( getWindow( WT_ObjectBrowser ) ) );
+#endif
 
   loadDockWindowsState();
 
@@ -1572,8 +1595,10 @@ void SalomeApp_Application::onStudyOpened( SUIT_Study* study )
 {
   LightApp_Application::onStudyOpened( study );
 
+#ifndef DISABLE_PYCONSOLE
   desktop()->tabifyDockWidget( windowDock( getWindow( WT_NoteBook ) ),
                                windowDock( getWindow( WT_ObjectBrowser ) ) );
+#endif
 
   loadDockWindowsState();
 
@@ -1707,6 +1732,7 @@ void SalomeApp_Application::objectBrowserColumnsVisibility()
     }
 }
 
+#ifndef DISABLE_PYCONSOLE
 /*! Set SalomeApp_NoteBook pointer */
 void SalomeApp_Application::setNoteBook( SalomeApp_NoteBook* theNoteBook )
 {
@@ -1718,6 +1744,7 @@ SalomeApp_NoteBook* SalomeApp_Application::getNoteBook() const
 {
   return myNoteBook;
 }
+#endif
 
 /*!
  * Define extra actions defined in module definition XML file.
@@ -1927,11 +1954,13 @@ bool SalomeApp_Application::renameObject( const QString& entry, const QString& n
 void SalomeApp_Application::defaultWindows( QMap<int, int>& aMap ) const
 {
   LightApp_Application::defaultWindows(aMap);
+#ifndef DISABLE_PYCONSOLE
   if ( !aMap.contains( WT_NoteBook ) ) {
     if ( !myNoteBook ) {
       aMap.insert( WT_NoteBook, Qt::LeftDockWidgetArea );
     }
   }
+#endif
 }
 
 /*!
@@ -1941,10 +1970,13 @@ void SalomeApp_Application::defaultWindows( QMap<int, int>& aMap ) const
 void SalomeApp_Application::currentWindows(QMap<int, int>& aMap) const
 {
   LightApp_Application::currentWindows( aMap );
+#ifndef DISABLE_PYCONSOLE
   if ( !aMap.contains( WT_NoteBook) && myNoteBook )
     aMap.insert( WT_NoteBook, Qt::LeftDockWidgetArea );
+#endif
 }
 
+#ifndef DISABLE_PYCONSOLE
 //============================================================================
 /*! Function : onUpdateStudy
  *  Purpose  : Slot to update the study.
@@ -2045,6 +2077,7 @@ bool SalomeApp_Application::updateStudy()
 
   return ok;
 }
+#endif
 
 //============================================================================
 /*! Function : onRestoreStudy
@@ -2066,9 +2099,11 @@ bool SalomeApp_Application::onRestoreStudy( const QString& theDumpScript,
   // load study from the temporary directory
   QString command = QString( "execfile(r\"%1\")" ).arg( theDumpScript );
 
+#ifndef DISABLE_PYCONSOLE
   PyConsole_Console* pyConsole = app->pythonConsole();
   if ( pyConsole )
     pyConsole->execAndWait( command );
+#endif
 
   // remove temporary directory
   QFileInfo aScriptInfo = QFileInfo( theDumpScript );
@@ -2082,12 +2117,14 @@ bool SalomeApp_Application::onRestoreStudy( const QString& theDumpScript,
 
   if( SalomeApp_Study* newStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) )
   {
+#ifndef DISABLE_PYCONSOLE
     _PTR(Study) aStudyDS = newStudy->studyDS();
     app->getNoteBook()->Init( aStudyDS );
     newStudy->updateFromNotebook(theStudyName, theIsStudySaved);
     newStudy->Modified();
     updateDesktopTitle();
     updateActions();
+#endif
   }
   else
     ok = false;
@@ -2100,11 +2137,13 @@ bool SalomeApp_Application::onRestoreStudy( const QString& theDumpScript,
 */
 void SalomeApp_Application::afterCloseDoc()
 {
+#ifndef DISABLE_PYCONSOLE
   // emit signal to restore study from Python script
   if ( myNoteBook ) {
     emit dumpedStudyClosed( myNoteBook->getDumpedStudyScript(),
                             myNoteBook->getDumpedStudyName(),
                             myNoteBook->isDumpedStudySaved() );
   }
+#endif
   LightApp_Application::afterCloseDoc();
 }
index 185ac65b87f6e2b6a1254fe82e97773bfc63ba47..88f577dcc0c6d4cdb4b9e166152b8c5792c79191 100644 (file)
@@ -48,7 +48,9 @@
 
 class LightApp_Preferences;
 class SalomeApp_Study;
-class SalomeApp_NoteBook;
+#ifndef DISABLE_PYCONSOLE
+  class SalomeApp_NoteBook;
+#endif
 class SUIT_Desktop;
 
 class SUIT_ViewModel;
@@ -110,9 +112,11 @@ public:
   virtual bool                        useStudy( const QString& );
   virtual void                        updateDesktopTitle();
   virtual void                        currentWindows( QMap<int, int>& ) const;
-  
+
+#ifndef DISABLE_PYCONSOLE
   virtual void                        setNoteBook(SalomeApp_NoteBook* theNoteBook);
   virtual SalomeApp_NoteBook*         getNoteBook() const;
+#endif
 
  //! update visibility state of objects
   void                                updateVisibilityState( DataObjectList& theList,
@@ -132,7 +136,9 @@ public slots:
   virtual void                        onCopy();
   virtual void                        onPaste();
   void                                onSaveGUIState();// called from VISU
+#ifndef DISABLE_PYCONSOLE
   void                                onUpdateStudy(); // called from NoteBook
+#endif
   bool                                onRestoreStudy( const QString& theDumpScript,
                                                       const QString& theStudyName,
                                                       bool theIsStudySaved );
@@ -171,7 +177,9 @@ protected:
 
   void                                objectBrowserColumnsVisibility();
 
+#ifndef DISABLE_PYCONSOLE
   bool                                updateStudy();
+#endif
 
   virtual void                        afterCloseDoc();
 
@@ -196,7 +204,9 @@ private:
   void                                createExtraActions();
 
 private:
+#ifndef DISABLE_PYCONSOLE
   QPointer<SalomeApp_NoteBook>        myNoteBook;
+#endif
   QMap<QString, QAction*>             myExtActions; // Map <AttributeUserID, QAction>
   bool                                myIsSiman; // application corresponds to the siman study flag
 
index 541ff70444ad159fc1741fa1b6493165cd61da5f..eb9b2c957485d70c9f71e3ea583cafc2f96836ce 100644 (file)
 // File:      SalomeApp_DoubleSpinBox.cxx
 // Author:    Oleg UVAROV
 //
-#include <PyConsole_Interp.h> // this include must be first (see PyInterp_base.h)!
-#include <PyConsole_Console.h>
+
+#ifndef DISABLE_PYCONSOLE
+  #include <PyConsole_Interp.h> // this include must be first (see PyInterp_base.h)!
+  #include <PyConsole_Console.h>
+#endif
 
 #include "SalomeApp_DoubleSpinBox.h"
 #include "SalomeApp_Application.h"
@@ -434,6 +437,7 @@ SalomeApp_DoubleSpinBox::SearchState SalomeApp_DoubleSpinBox::findVariable( cons
         {
           if( studyDS->IsString( aName ) )
             {
+#ifndef DISABLE_PYCONSOLE
               PyConsole_Console* pyConsole = app->pythonConsole();
               PyConsole_Interp* pyInterp = pyConsole->getInterp();
               PyLockWrapper aLock = pyInterp->GetLockWrapper();
@@ -448,6 +452,7 @@ SalomeApp_DoubleSpinBox::SearchState SalomeApp_DoubleSpinBox::findVariable( cons
                 {
                   return IncorrectType;
                 }
+#endif
             }
           value = studyDS->GetReal( aName );
           return Found;
index 6ced85db854dcf30dc5d2cf473f6c6c3e9439f4a..4460cd446b317a634f9605c6f2b8816398ce2f21 100644 (file)
 // File:      SalomeApp_IntSpinBox.cxx
 // Author:    Oleg UVAROV
 //
-#include <PyConsole_Interp.h> //this include must be first (see PyInterp_base.h)!
-#include <PyConsole_Console.h>
+
+#ifndef DISABLE_PYCONSOLE
+  #include <PyConsole_Interp.h> //this include must be first (see PyInterp_base.h)!
+  #include <PyConsole_Console.h>
+#endif
 
 #include "SalomeApp_IntSpinBox.h"
 #include "SalomeApp_Application.h"
@@ -382,6 +385,7 @@ SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QStr
         {
           if( studyDS->IsString( aName ) )
             {
+#ifndef DISABLE_PYCONSOLE
               PyConsole_Console* pyConsole = app->pythonConsole();
               PyConsole_Interp* pyInterp = pyConsole->getInterp();
               PyLockWrapper aLock = pyInterp->GetLockWrapper();
@@ -396,6 +400,7 @@ SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QStr
                 {
                   return IncorrectType;
                 }
+#endif
             }
           value = studyDS->GetInteger( aName );
           return Found;
index 2427203b32e44b90ba83f473c773d87e2496b981..06ab382037a80d8bf8edd3f85e58352861b0892d 100644 (file)
@@ -334,11 +334,13 @@ public:
         }
         break;
       }
+#ifndef DISABLE_PYCONSOLE
     case 6: //NoteBook variables were modified
       {
        myStudy->onNoteBookVarUpdate( QString( theID.c_str() ) );
        break;
       }
+#endif
     default:MESSAGE("Unknown event: "  << event);break;
     } //switch
   } //notifyObserverID_real
@@ -402,10 +404,12 @@ SalomeApp_Study::~SalomeApp_Study()
   }
 }
 
+#ifndef DISABLE_PYCONSOLE
 void SalomeApp_Study::onNoteBookVarUpdate( QString theVarName)
 {
   emit notebookVarUpdated( theVarName );
 }
+#endif
 
 /*!
   Gets study id.
@@ -1150,6 +1154,7 @@ void SalomeApp_Study::RemoveTemporaryFiles ( const char* theModuleName, const bo
   }
 }
 
+#ifndef DISABLE_PYCONSOLE
 /*!
   Mark the study as saved in the file
   \param theFileName - the name of file
@@ -1160,6 +1165,7 @@ void SalomeApp_Study::updateFromNotebook( const QString& theFileName, bool isSav
   studyDS()->Name(theFileName.toStdString());
   setIsSaved( isSaved );
 }
+#endif
 
 LightApp_DataObject* SalomeApp_Study::findObjectByEntry( const QString& theEntry )
 {
index ff91d422a7f8d6d56ec73696f486e269c76c7f17..e453770073170e8f174277d7e23e14594bb5337d 100644 (file)
@@ -83,7 +83,9 @@ public:
   void                setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint);
 
   virtual void        restoreState(int savePoint);
+#ifndef DISABLE_PYCONSOLE
   void                updateFromNotebook(const QString&, bool);
+#endif
 
   virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry );
 
@@ -106,7 +108,9 @@ protected:
                                                SUIT_DataObject* theParent ) const;
 protected slots:
   virtual void        updateModelRoot( const CAM_DataModel* );
+#ifndef DISABLE_PYCONSOLE
   void                onNoteBookVarUpdate( QString theVarName );
+#endif
 
 private:
   QString             newStudyName() const;
@@ -115,8 +119,10 @@ private:
   _PTR(Study)         myStudyDS;
   Observer_i*         myObserver;
 
+#ifndef DISABLE_PYCONSOLE
  signals:
   void                notebookVarUpdated( QString theVarName );
+#endif
 };
 
 #ifdef WIN32
index 2bd6af60132146374773c50fc38c82ebb3fe7b03..460f13136cbbf630027f7ea5d7bade40e7abb6b5 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-SET(SUBDIRS
-  vtkEDFOverloads
-  dlgfactory
-)
-FOREACH(dir ${SUBDIRS})
-  ADD_SUBDIRECTORY(${dir})
-ENDFOREACH(dir ${SUBDIRS})
-            
+ADD_SUBDIRECTORY(dlgfactory)
+
+IF(SALOME_USE_VTKVIEWER)
+  ADD_SUBDIRECTORY(vtkEDFOverloads)            
+ENDIF()