Salome HOME
1024f275d6526488dff58f37acee2f9a42fcec8c
[modules/shaper.git] / src / NewGeom / NewGeom_DataModel.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3
4 #ifndef NEWGEOM_DATAMODEL_H
5 #define NEWGEOM_DATAMODEL_H
6
7 #include "NewGeom.h"
8 #include <LightApp_DataModel.h>
9
10 class NewGeom_Module;
11
12 class NewGeom_EXPORT NewGeom_DataModel : public LightApp_DataModel
13 {
14   Q_OBJECT
15  public:
16   NewGeom_DataModel(NewGeom_Module* theModule);
17   virtual ~NewGeom_DataModel();
18
19   virtual bool open(const QString& thePath, CAM_Study* theStudy, QStringList theFiles);
20   virtual bool save(QStringList& theFiles);
21   virtual bool saveAs(const QString& thePath, CAM_Study* theStudy, QStringList& theFiles);
22   virtual bool close();
23   virtual bool create(CAM_Study* theStudy);
24
25   virtual bool isModified() const;
26   virtual bool isSaved() const;
27
28   virtual void update(LightApp_DataObject* theObj = 0, LightApp_Study* theStudy = 0);
29
30 protected:
31   /**
32    * Removes the directory with content if it exists
33    * \param theDirectoryName a directory name
34    */
35   static void removeDirectory(const QString& theDirectoryName);
36
37  private:
38   QString myStudyPath;
39   QString myTmpDirectory; /// a path to the temporary directory, created by opening a document file
40   /// it should be created because the files reading is postponed in the module. The directory
41   // should be removed after the model document is closed.
42   NewGeom_Module* myModule;
43 };
44
45 #endif