]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Dump of study to Python GUI first implementation.
authoradv <adv@opencascade.com>
Fri, 6 Sep 2013 13:13:41 +0000 (13:13 +0000)
committeradv <adv@opencascade.com>
Fri, 6 Sep 2013 13:13:41 +0000 (13:13 +0000)
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_DataModel.h

index 798cf88ed181a2ca635233e75e260fc7e699509d..fc7a38380a520a395bc0315d75568ca3fed7a484 100644 (file)
@@ -53,6 +53,8 @@
 #include <TDF_Delta.hxx>
 #include <TDF_ListIteratorOfDeltaList.hxx>
 
+#include <QApplication>
+
 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();
index a0e597647d9a4d902bb3a16932f669e6c6e069d9..1c5de1d7d7534bb2a77804c5713c163ddf079ccc 100644 (file)
@@ -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