# 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:
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)
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()
# 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)
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:
# 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:
# 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)
# 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
# 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@")
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)
##
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)
##
# 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
#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"
// ... "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 );
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 );
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
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" );
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" );
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
a->setShortcut( ob->shortcutKey(SUIT_DataBrowser::UpdateShortcut) );
}
+#ifndef DISABLE_SALOMEOBJECT
if ( selMgr && ob ) {
SALOME_ListIO selected;
selMgr->selectedObjects( selected );
}
}
}
+#endif
selMgr->setSelectionCacheEnabled( cacheIsOn );
}
#include <QMenuBar>
#include <QStatusBar>
-#include <PyConsole_Console.h>
-
#include <STD_Application.h>
#include <SUIT_Session.h>
#include <QVariant>
#include <QString>
#include <QStringList>
+#include <QAction>
#include <iostream>
#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
*/
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()),"","") );
}
}
}
if(v)
v->setObjectsSelected(anIOList);
+#endif
}
/*!On selection changed.*/
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
/*!
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();
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 )
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 ---
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
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})
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})
*/
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);
}
/*
*/
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());
if(updateView)
myPlot->replot();
-#endif
}
/*
*/
void Plot2d_ViewFrame::updateAnalyticalCurves()
{
-#ifndef DISABLE_PYCONSOLE
AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
for( ; it != myAnalyticalCurves.end(); it++) {
updateAnalyticalCurve(*it);
}
myPlot->replot();
-#endif
}
/*!
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
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" ),
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" ),
#
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)
# 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 ---
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
- "-DCALL_OLD_METHODS"
${QT_DEFINITIONS}
${CAS_DEFINITIONS}
${PYTHON_DEFINITIONS}
#
INCLUDE(UsePyQt4)
-INCLUDE(${VTK_USE_FILE})
+IF(SALOME_USE_VTKVIEWER)
+ INCLUDE(${VTK_USE_FILE})
+ENDIF()
# --- options ---
# 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
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;
#
INCLUDE(UsePyQt4)
-INCLUDE(${VTK_USE_FILE})
+IF(SALOME_USE_VTKVIEWER)
+ INCLUDE(${VTK_USE_FILE})
+ENDIF()
# --- options ---
#
INCLUDE(${SWIG_USE_FILE})
-INCLUDE(${VTK_USE_FILE})
+IF(SALOME_USE_VTKVIEWER)
+ INCLUDE(${VTK_USE_FILE})
+ENDIF()
# --- options ---
#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
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();
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();
}
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
}
}
}
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
}
}
}
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:
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;
break;
}
}
+#endif
}
}
}
# 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()
// 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
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] );
}
}
-#ifdef SUIT_ENABLE_PYTHON
+#ifndef DISABLE_PYCONSOLE
//...Initialize python
int _argc = 1;
char* _argv[] = {(char*)""};
ENDIF()
INCLUDE(UseQt4Ext)
-INCLUDE(${VTK_USE_FILE})
+IF(SALOME_USE_VTKVIEWER)
+ INCLUDE(${VTK_USE_FILE})
+ENDIF()
# --- options ---
${QT_INCLUDES}
${QWT_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
- ${PYTHON_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIR}
${OMNIORB_INCLUDE_DIR}
${PROJECT_BINARY_DIR}/idl
${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
${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}
${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
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
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})
SalomeApp_ListView.cxx
SalomeApp_LoadStudiesDlg.cxx
SalomeApp_Module.cxx
- SalomeApp_NoteBook.cxx
- SalomeApp_PyInterp.cxx
SalomeApp_Study.cxx
SalomeApp_StudyPropertiesDlg.cxx
SalomeApp_Tools.cxx
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})
// 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"
#include "SalomeApp_VisualState.h"
#include "SalomeApp_StudyPropertiesDlg.h"
#include "SalomeApp_LoadStudiesDlg.h"
-#include "SalomeApp_NoteBook.h"
-
#include "SalomeApp_ExitDlg.h"
#include <LightApp_Application.h>
// temporary commented
//#include <OB_ListItem.h>
-#include <PyConsole_Console.h>
#include <Utils_ORB_INIT.hxx>
#include <Utils_SINGLETON.hxx>
updateObjectBrowser(true);
}
+#ifndef DISABLE_PYCONSOLE
// import/execute python scripts
if ( pyfiles.count() > 0 && activeStudy() ) {
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
}
}
}
+#endif
} else {
LightApp_Application::start();
SALOME_EventFilter::Init();
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");
PyErr_Print();
PyGILState_Release(gstate);
// end of SALOME plugins loading
+#endif
+#endif
}
QString command = QString("execfile(r\"%1\")").arg(aFile);
+#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = pythonConsole();
if ( pyConsole )
pyConsole->exec( command );
+#endif
}
}
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;
}
{
QString command = QString("execfile(r\"%1\")").arg(aFile);
+#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = pythonConsole();
if ( pyConsole )
pyConsole->exec( command );
+#endif
}
}
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();
*/
}
}
+#ifndef DISABLE_PYCONSOLE
else if ( flag == WT_PyConsole )
{
PyConsole_Console* pyCons = new PyConsole_EnhConsole( desktop(), new SalomeApp_PyInterp() );
}
wid = getNoteBook();
}
+#endif
return wid;
}
}
-/*!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;
{
LightApp_Application::onStudyCreated( study );
+#ifndef DISABLE_PYCONSOLE
desktop()->tabifyDockWidget( windowDock( getWindow( WT_NoteBook ) ),
windowDock( getWindow( WT_ObjectBrowser ) ) );
+#endif
loadDockWindowsState();
{
LightApp_Application::onStudyOpened( study );
+#ifndef DISABLE_PYCONSOLE
desktop()->tabifyDockWidget( windowDock( getWindow( WT_NoteBook ) ),
windowDock( getWindow( WT_ObjectBrowser ) ) );
+#endif
loadDockWindowsState();
}
}
+#ifndef DISABLE_PYCONSOLE
/*! Set SalomeApp_NoteBook pointer */
void SalomeApp_Application::setNoteBook( SalomeApp_NoteBook* theNoteBook )
{
{
return myNoteBook;
}
+#endif
/*!
* Define extra actions defined in module definition XML file.
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
}
/*!
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.
return ok;
}
+#endif
//============================================================================
/*! Function : onRestoreStudy
// 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 );
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;
*/
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();
}
class LightApp_Preferences;
class SalomeApp_Study;
-class SalomeApp_NoteBook;
+#ifndef DISABLE_PYCONSOLE
+ class SalomeApp_NoteBook;
+#endif
class SUIT_Desktop;
class SUIT_ViewModel;
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,
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 );
void objectBrowserColumnsVisibility();
+#ifndef DISABLE_PYCONSOLE
bool updateStudy();
+#endif
virtual void afterCloseDoc();
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
// 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"
{
if( studyDS->IsString( aName ) )
{
+#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = app->pythonConsole();
PyConsole_Interp* pyInterp = pyConsole->getInterp();
PyLockWrapper aLock = pyInterp->GetLockWrapper();
{
return IncorrectType;
}
+#endif
}
value = studyDS->GetReal( aName );
return Found;
// 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"
{
if( studyDS->IsString( aName ) )
{
+#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = app->pythonConsole();
PyConsole_Interp* pyInterp = pyConsole->getInterp();
PyLockWrapper aLock = pyInterp->GetLockWrapper();
{
return IncorrectType;
}
+#endif
}
value = studyDS->GetInteger( aName );
return Found;
}
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
}
}
+#ifndef DISABLE_PYCONSOLE
void SalomeApp_Study::onNoteBookVarUpdate( QString theVarName)
{
emit notebookVarUpdated( theVarName );
}
+#endif
/*!
Gets study id.
}
}
+#ifndef DISABLE_PYCONSOLE
/*!
Mark the study as saved in the file
\param theFileName - the name of file
studyDS()->Name(theFileName.toStdString());
setIsSaved( isSaved );
}
+#endif
LightApp_DataObject* SalomeApp_Study::findObjectByEntry( const QString& theEntry )
{
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 );
SUIT_DataObject* theParent ) const;
protected slots:
virtual void updateModelRoot( const CAM_DataModel* );
+#ifndef DISABLE_PYCONSOLE
void onNoteBookVarUpdate( QString theVarName );
+#endif
private:
QString newStudyName() const;
_PTR(Study) myStudyDS;
Observer_i* myObserver;
+#ifndef DISABLE_PYCONSOLE
signals:
void notebookVarUpdated( QString theVarName );
+#endif
};
#ifdef WIN32
# 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()