CMAKE_DEPENDENT_OPTION(SALOME_USE_SALOMEOBJECT "Enable Salome Object (Mandatory in classic configurations)" ON
"SALOME_LIGHT_ONLY" ON)
-OPTION(SALOME_USE_SINGLE_DESKTOP "Enable multiple document interface" ON)
MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_VTKVIEWER SALOME_USE_GRAPHICSVIEW SALOME_USE_PVVIEWER)
MARK_AS_ADVANCED(SALOME_USE_SALOMEOBJECT SALOME_USE_OCCVIEWER SALOME_USE_GLVIEWER SALOME_USE_PLOT2DVIEWER)
MARK_AS_ADVANCED(SALOME_USE_PYCONSOLE SALOME_USE_QXGRAPHVIEWER SALOME_USE_PYVIEWER)
-MARK_AS_ADVANCED(SALOME_USE_SINGLE_DESKTOP)
# Prerequisites
# =============
ADD_DEFINITIONS(-DWITH_SALOMEDS_OBSERVER)
ENDIF()
-# Single-study GUI
-IF(SALOME_USE_SINGLE_DESKTOP)
- ADD_DEFINITIONS(-DSINGLE_DESKTOP)
-ENDIF()
-
# OCCT
FIND_PACKAGE(SalomeCAS REQUIRED)
SET(SALOME_USE_PYVIEWER @SALOME_USE_PYVIEWER@)
SET(SALOME_USE_PYCONSOLE @SALOME_USE_PYCONSOLE@)
SET(SALOME_USE_SALOMEOBJECT @SALOME_USE_SALOMEOBJECT@)
-SET(SALOME_USE_SINGLE_DESKTOP @SALOME_USE_SINGLE_DESKTOP@)
SET(SALOME_GUI_USE_OBSERVERS @SALOME_GUI_USE_OBSERVERS@)
SET(SALOME_GUI_USE_OPENGL2 @SALOME_GUI_USE_OPENGL2@)
IF(SALOME_GUI_LIGHT_ONLY)
LIST(APPEND GUI_DEFINITIONS "-DGUI_DISABLE_CORBA")
ENDIF()
-IF(SALOME_USE_SINGLE_DESKTOP)
- LIST(APPEND GUI_DEFINITIONS "-DSINGLE_DESKTOP")
-ENDIF()
IF(SALOME_GUI_USE_OBSERVERS)
LIST(APPEND GUI_DEFINITIONS "-DWITH_SALOMEDS_OBSERVER")
ENDIF()
*/
void LightApp_Application::onNewDoc()
{
-#ifdef SINGLE_DESKTOP
if ( !checkExistingDoc() )
return;
-#endif
//asl: fix for 0020515
saveDockWindowsState();
{
SUIT_Study* study = activeStudy();
-#ifdef SINGLE_DESKTOP
if ( !checkExistingDoc() )
return;
-#endif
CAM_Application::onOpenDoc();
*/
bool LightApp_Application::onOpenDoc( const QString& aName )
{
-#ifdef SINGLE_DESKTOP
if ( !checkExistingDoc() )
return false;
-#endif
saveDockWindowsState();
return ProcessEvent( new TGetObjectBrowserEvent() );
}
-/*!
- \fn int SalomePyQt::getStudyId();
- \brief Get active study's identifier.
- \return active study ID or 0 if there is no active study
-*/
-
-class TGetStudyIdEvent: public SALOME_Event
-{
-public:
- typedef int TResult;
- TResult myResult;
- TGetStudyIdEvent() : myResult( 0 ) {}
- virtual void Execute()
- {
- if ( LightApp_Study* aStudy = getActiveStudy() ) {
- myResult = aStudy->id();
- }
- }
-};
-int SalomePyQt::getStudyId()
-{
- return ProcessEvent( new TGetStudyIdEvent() );
-}
-
/*!
\fn SALOME_Selection* SalomePyQt::getSelection();
\brief Get the selection object for the current study.
}
/*!
- \brief Update an Object Browser of the specified (by identifier) study.
+ \brief Update an Object Browser of the study.
- If \a studyId <= 0 the active study's object browser is updated.
The \a updateSelection parameter is obsolete and currently is not used.
This parameter will be removed in future, so try to avoid its usage in
your code.
- \brief studyId study identifier
\brief updateSelection update selection flag (not used)
\sa getActiveStudy()
*/
static QMenu* getPopupMenu( const QString& );
static QTreeView* getObjectBrowser();
static SALOME_Selection* getSelection();
- static int getStudyId();
static void putInfo( const QString&, const int = 0 );
static const QString getActiveComponent();
static PyObject* getActivePythonModule();
static QMenu* getPopupMenu( const QString& ) /ReleaseGIL/ ;
static QTreeView* getObjectBrowser() /ReleaseGIL/ ;
static SALOME_Selection* getSelection() /Factory,ReleaseGIL/ ;
- static int getStudyId() /ReleaseGIL/ ;
static void putInfo( const QString&, const int = 0 ) /ReleaseGIL/ ;
static const QString getActiveComponent() /ReleaseGIL/ ;
static SIP_PYOBJECT getActivePythonModule() /ReleaseGIL/ ;
This module provides an access to the SALOME GUI implementing set of functions
which can be used from Python. This module is implemented using SWIG wrappings
for some GUI functionality:
- - getActiveStudyId(), getActiveStudyName() : get active study identifier and name
+ - getActiveStudyName() : get active study name
- updateObjBrowser() : update contents of the Object Browser
- SelectedCount() : get number of currently selected items
- getSelected() : get entry of the speicified selected item
ProcessVoidEvent( new TEvent() );
}
-/*!
- \fn int SALOMEGUI_Swig::getActiveStudyId()
- \brief Get active study identifier
- \return active study's ID or 0 if there is no active study
-*/
-
-class TGetActiveStudyIdEvent: public SALOME_Event
-{
-public:
- typedef int TResult;
- TResult myResult;
- TGetActiveStudyIdEvent() : myResult( 0 ) {}
- virtual void Execute()
- {
- if ( LightApp_Study* aStudy = getActiveStudy() ) {
- myResult = aStudy->id();
- }
- }
-};
-int SALOMEGUI_Swig::getActiveStudyId()
-{
- return ProcessEvent( new TGetActiveStudyIdEvent() );
-}
-
/*!
\fn const char* SALOMEGUI_Swig::getActiveStudyName()
\brief Get active study name
void updateObjBrowser( bool );
- int getActiveStudyId();
const char* getActiveStudyName();
const char* getComponentName( const char* );
void updateObjBrowser(bool);
/* get active study */
- int getActiveStudyId();
const char *getActiveStudyName();
/* get component name/username */
#include <SALOME_InteractiveObject.hxx>
#include <SALOME_ListIO.hxx>
-// Temporarily commented to avoid awful dependecy on SALOMEDS
-// TODO: better mechanism of storing display/erse status in a study
-// should be provided...
-//#include <Utils_ORB_INIT.hxx>
-//#include <Utils_SINGLETON.hxx>
-//#include <SALOME_ModuleCatalog_impl.hxx>
-//#include <SALOME_NamingService.hxx>
-
-//#include "SALOMEDSClient.hxx"
-//#include "SALOMEDS_StudyManager.hxx"
-
#include <AIS_TypeOfIso.hxx>
#include <Precision.hxx>
#include <algorithm>
-// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
-// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
-// SALOMEDS::StudyManager - no linkage with SalomeApp.
-
-// Temporarily commented to avoid awful dependecy on SALOMEDS
-// TODO: better mechanism of storing display/erse status in a study
-// should be provided...
-//static _PTR(Study) getStudyDS()
-//{
-// SALOMEDSClient_Study* aStudy = NULL;
-// _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
-
- // get id of SUIT_Study, if it's a SalomeApp_Study, it will return
- // id of its underlying SALOMEDS::Study
-// SUIT_Application* app = SUIT_Session::session()->activeApplication();
-// if ( !app ) return _PTR(Study)(aStudy);
-// SUIT_Study* stud = app->activeStudy();
-// if ( !stud ) return _PTR(Study)(aStudy);
-// const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
- // get SALOMEDS_Study with this id from StudyMgr
-// return aMgr->GetStudyByID( id );
-//}
-
/*!
Constructor
\param DisplayTrihedron - is trihedron displayed
#include <qwt_plot_curve.h>
#include <stdlib.h>
-//ASL: Temporary commented in order to avoir dependency on SALOMEDS
-
-//#include "SALOMEDSClient.hxx"
-//#include "SALOMEDS_StudyManager.hxx"
-
-// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
-// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
-// SALOMEDS::StudyManager - no linkage with SalomeApp.
-
-/*static _PTR(Study) getStudyDS()
-{
- SALOMEDSClient_Study* aStudy = NULL;
- _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
-
- // get id of SUIT_Study, if it's a SalomeApp_Study, it will return
- // id of its underlying SALOMEDS::Study
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if ( !app ) return _PTR(Study)(aStudy);
- SUIT_Study* stud = app->activeStudy();
- if ( !stud ) return _PTR(Study)(aStudy);
- const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
- // get SALOMEDS_Study with this id from StudyMgr
- return aMgr->GetStudyByID( id );
-} */
-
/*!
Constructor
*/
// VSR: Uncomment below line to allow texture background support in VTK viewer
#define VTK_ENABLE_TEXTURED_BACKGROUND
-
-// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
-// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
-// SALOMEDS::StudyManager - no linkage with SalomeApp.
-
-// Temporarily commented to avoid awful dependecy on SALOMEDS
-// TODO: better mechanism of storing display/erse status in a study
-// should be provided...
-//static _PTR(Study) getStudyDS()
-//{
-// SALOMEDSClient_Study* aStudy = NULL;
-// _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
- // get id of SUIT_Study, if it's a SalomeApp_Study, it will return
- // id of its underlying SALOMEDS::Study
-// SUIT_Application* app = SUIT_Session::session()->activeApplication();
-// if ( !app ) return _PTR(Study)(aStudy);
-// SUIT_Study* stud = app->activeStudy();
-// if ( !stud ) return _PTR(Study)(aStudy);
-// const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
- // get SALOMEDS_Study with this id from StudyMgr
-// return aMgr->GetStudyByID( id );
-//}
-
/*!
Constructor
*/
/*!SLOT. Load document with \a aName.*/
bool SalomeApp_Application::onLoadDoc( const QString& aName )
{
-#ifdef SINGLE_DESKTOP
if ( !LightApp_Application::closeDoc() )
return false;
-#endif
+
bool res = true;
if ( !activeStudy() ) {
// if no study - load in current desktop
return _orb;
}
-/*!Create and return SALOMEDS_StudyManager.*/
+/*!Create and return SALOMEDS_Study.*/
SALOMEDSClient_Study* SalomeApp_Application::getStudy()
{
static _PTR(Study) _study;
}
/*!
- Connects GUI study to SALOMEDS one already loaded into StudyManager
+ Connects GUI study to SALOMEDS one
\param theStudyName - name of study
*/
bool SalomeApp_Study::loadDocument( const QString& theStudyName )
{
MESSAGE( "loadDocument" );
- // obtain myStudyDS from StudyManager
- _PTR(Study) study = studyDS();
- if ( !study )
- return false;
-
- setStudyDS( study );
-
setRoot( new SalomeApp_RootObject( this ) ); // create myRoot
//SRN: BugID IPAL9021, put there the same code as in a method openDocument
app->getPyInterp()->destroy();
#endif
}
- SALOMEDSClient_Study* aStudy = 0;
- setStudyDS( _PTR(Study)(aStudy) );
}
}
// counted objects, they will be deleted by the POA when they are no
// longer needed.
-// ClientFactory::createStudyManager(_orb,_root_poa);
+// ClientFactory::createStudyManager(_orb,_root_poa); NB!!!
}
catch(CORBA::SystemException&) {
INFOS( "Caught CORBA::SystemException." );
return myStats._retn() ;
}
-CORBA::Long SALOME_Session_i::GetActiveStudyId()
-{
- long aStudyId=-1;
- if ( SUIT_Session::session() && SUIT_Session::session()->activeApplication() ) {
- if ( SUIT_Session::session()->activeApplication()->activeStudy() ) // mkr : IPAL12128
- aStudyId = SUIT_Session::session()->activeApplication()->activeStudy()->id();
- }
- return aStudyId;
-}
-
CORBA::Long SALOME_Session_i::getPID() {
return (CORBA::Long)
#ifndef WIN32
//! Unregister the servant from Naming Service
void NSunregister();
- CORBA::Long GetActiveStudyId();
-
void ping(){};
CORBA::Long getPID();
char* getHostname();