#ifndef HYDROGUI_DATAMODEL_H
#define HYDROGUI_DATAMODEL_H
-#include "HYDROGUI.h"
-
+#include <HYDROData_Document.h>
#include <HYDROData_Object.h>
#include <QMap>
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,
/**
* 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,
*/
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;
/**
* 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 );
*/
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