From 210f2e7ee849ce34bf8ce2f02cf2c1ed75e9e64a Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 7 Nov 2011 14:40:42 +0000 Subject: [PATCH] 021419: [CEA 516] Invalid tree representation of ATOMIC light-component Additionally merge from BR_PPGP_Dev branch (07/11/2011) --- .../SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx | 8 ++++---- .../SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.h | 2 +- .../SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx | 8 ++++++++ .../SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h | 3 +++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx index 50c68b261..17c8f531b 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx @@ -152,12 +152,12 @@ void SALOME_PYQT_DataModelLight::update ( LightApp_DataObject* theObj, LightApp_ return; } -LightApp_ModuleObject* SALOME_PYQT_DataModelLight::getRoot() +CAM_DataObject* SALOME_PYQT_DataModelLight::getRoot() { LightApp_Study* study = dynamic_cast( module()->application()->activeStudy() ); - LightApp_ModuleObject *aModelRoot = dynamic_cast(root()); - if(aModelRoot == NULL) { - aModelRoot = new LightApp_ModuleObject(this,study->root()); + CAM_ModuleObject *aModelRoot = dynamic_cast(root()); + if(study && aModelRoot == NULL) { + aModelRoot = createModuleObject( study->root() ); aModelRoot->setDataModel( this ); setRoot(aModelRoot); } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.h b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.h index b49dc9cc2..2a6c2f21d 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.h @@ -52,7 +52,7 @@ public: virtual void update ( LightApp_DataObject* = 0, LightApp_Study* = 0 ); - LightApp_ModuleObject* getRoot(); + CAM_DataObject* getRoot(); private: QString myFileName; diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx index cd02deade..a28601baf 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx @@ -2775,3 +2775,11 @@ CAM_DataModel* SALOME_PYQT_ModuleLight::createDataModel() MESSAGE( "SALOME_PYQT_ModuleLight::createDataModel()" ); return new SALOME_PYQT_DataModelLight(this); } + +/*! + * Returns the Python module object currently loaded. + */ +PyObject* SALOME_PYQT_ModuleLight::getPythonModule() +{ + return myModule; +} diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h index 0285aef55..6917f3a1d 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h @@ -148,6 +148,9 @@ public: /*return list of child objets*/ QStringList getChildren(const QString& obj, const bool rec); + /*Access to the underlying Python module object */ + PyObject* getPythonModule(); + public slots: virtual bool activateModule( SUIT_Study* ); -- 2.39.2