Salome HOME
Dump Image data to python script (Feature #13).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_DataModel.h
index 063d0166461cda7a54af1ec9672738a5b4ff8a21..1c5de1d7d7534bb2a77804c5713c163ddf079ccc 100644 (file)
@@ -23,8 +23,7 @@
 #ifndef HYDROGUI_DATAMODEL_H
 #define HYDROGUI_DATAMODEL_H
 
-#include "HYDROGUI.h"
-
+#include <HYDROData_Document.h>
 #include <HYDROData_Object.h>
 
 #include <QMap>
@@ -36,25 +35,25 @@ class CAM_DataObject;
 class SUIT_DataObject;
 class HYDROGUI_DataObject;
 
-/*!
+/**
  * \class HYDROGUI_DataModel
  * \brief The class representing the HYDROGUI data model
  */
 class HYDROGUI_DataModel : public LightApp_DataModel, public SUIT_DataSearcher
 {
 public:
- /**
-  * Constructor.
-  * \param theModule module object
-  */
 /**
+   * Constructor.
+   * \param theModule module object
+   */
   HYDROGUI_DataModel( CAM_Module* theModule );
   virtual ~HYDROGUI_DataModel();
 
   /**
    * Open the document into the data model. Reimplemented.
-   * /param theURL opened study path
-   * /param theStudy object study
-   * /param theFileList list of opened files for this model.
+   * \param theURL opened study path
+   * \param theStudy object study
+   * \param theFileList list of opened files for this model.
    */
   virtual bool open( const QString& theURL,
                      CAM_Study* theStudy,
@@ -62,15 +61,15 @@ public:
 
   /**
    * Saves the document. Reimplemented.
-   * /param returned theFileList list of saved files of this model.
+   * \param returned theFileList list of saved files of this model.
    */
   virtual bool save( QStringList& theFileList );
 
   /**
    * Saves as the document. Reimplemented.
-   * /param theURL saved study path
-   * /param theStudy object study
-   * /param returned theFileList list of saved files of this model.
+   * \param theURL saved study path
+   * \param theStudy object study
+   * \param returned theFileList list of saved files of this model.
    */
   virtual bool saveAs( const QString& theURL,
                        CAM_Study* theStudy,
@@ -81,9 +80,17 @@ 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
+   * \return boolean value of modification status
    */
   virtual bool isModified() const;
 
@@ -121,8 +128,8 @@ public:
 
   /**
    * Updates the internal structure of data object tree starting from specified data object \a obj.
-   * /param theObject start data object
-   * /param theStudy study object
+   * \param theObject start data object
+   * \param theStudy study object
    */
   virtual void update( LightApp_DataObject* theObject = 0,
                        LightApp_Study* theStudy = 0 );
@@ -137,14 +144,66 @@ public:
    */
   void updateModel();
 
+  /**
+   * Find a data object by the specified entry and kind
+   */
+  Handle(HYDROData_Object) objectByEntry( const QString& theEntry,
+                                          const ObjectKind theObjectKind = KIND_UNKNOWN );
+
+  /**
+   * Check if it is possible to perform 'undo' operation
+   */
+  bool canUndo() const;
+
+  /**
+   * Check if it is possible to perform 'redo' operation
+   */
+  bool canRedo() const;
+
+  /**
+   * Returns the list of names of available 'undo' actions
+   */
+  QStringList undoNames() const;
+
+  /**
+   * Returns the list of names of available 'redo' actions
+   */
+  QStringList redoNames() const;
+
+  /**
+   * Clear the list of stored 'undo' actions
+   */
+  void clearUndos();
+
+  /**
+   * Clear the list of stored 'redo' actions
+   */
+  void clearRedos();
+
+  /**
+   * Perform the 'undo' operation
+   */
+  bool undo();
+
+  /**
+   * Perform the 'redo' operation
+   */
+  bool redo();
+
 protected:
+  /**
+   * Returns the document for the current study
+   */
+  Handle(HYDROData_Document) getDocument() const;
+
   /**
    * Creates the GUI data object according to the model object.
    * \param theParent a created object will be appended as a child of this object
    * \param theObject model object
    */
   LightApp_DataObject* createObject( SUIT_DataObject* theParent,
-                                     Handle(HYDROData_Object) theModelObject );
+                                     Handle(HYDROData_Object) theModelObject,
+                                     const QString& theParentEntry = QString() );
 
   /**
    * Creates the GUI data object without corresponding model object: just by name