From: adv Date: Fri, 6 Sep 2013 13:13:41 +0000 (+0000) Subject: Dump of study to Python GUI first implementation. X-Git-Tag: BR_hydro_v_0_1~61 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f253c32c980c4e6bc80a9966af11490191dfb093;p=modules%2Fhydro.git Dump of study to Python GUI first implementation. --- diff --git a/src/HYDROGUI/HYDROGUI_DataModel.cxx b/src/HYDROGUI/HYDROGUI_DataModel.cxx index 798cf88e..fc7a3838 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModel.cxx @@ -53,6 +53,8 @@ #include #include +#include + HYDROGUI_DataModel::HYDROGUI_DataModel( CAM_Module* theModule ) : LightApp_DataModel( theModule ) { @@ -148,6 +150,34 @@ bool HYDROGUI_DataModel::close() return true; } +bool HYDROGUI_DataModel::dumpPython( const QString& theURL, + CAM_Study* theStudy, + bool isMultiFile, + QStringList& theListOfFiles ) +{ + int aStudyId = theStudy->id(); + + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( aStudyId ); + if( aDocument.IsNull() ) + return false; + + QString aFileToExport = theURL; + + if ( isMultiFile ) + { + // each module's dump is written into a separate Python file + } + + + QApplication::setOverrideCursor( Qt::WaitCursor ); + + bool aRes = aDocument->DumpToPython( aFileToExport ); + + QApplication::restoreOverrideCursor(); + + return aRes; +} + bool HYDROGUI_DataModel::isModified() const { return getDocument()->IsModified(); diff --git a/src/HYDROGUI/HYDROGUI_DataModel.h b/src/HYDROGUI/HYDROGUI_DataModel.h index a0e59764..1c5de1d7 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.h +++ b/src/HYDROGUI/HYDROGUI_DataModel.h @@ -80,6 +80,14 @@ public: */ virtual bool close(); + /** + * Dump study data to Python script. Reimplemented. + */ + virtual bool dumpPython( const QString& theURL, + CAM_Study* theStudy, + bool isMultiFile, + QStringList& theListOfFiles ); + /** * Returns modification status. Reimplemented. * \return boolean value of modification status