From f253c32c980c4e6bc80a9966af11490191dfb093 Mon Sep 17 00:00:00 2001 From: adv Date: Fri, 6 Sep 2013 13:13:41 +0000 Subject: [PATCH] Dump of study to Python GUI first implementation. --- src/HYDROGUI/HYDROGUI_DataModel.cxx | 30 +++++++++++++++++++++++++++++ src/HYDROGUI/HYDROGUI_DataModel.h | 8 ++++++++ 2 files changed, 38 insertions(+) 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 -- 2.39.2