1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 #ifndef NEWGEOM_DATAMODEL_H
5 #define NEWGEOM_DATAMODEL_H
8 #include <LightApp_DataModel.h>
14 * A Data Model class provides a connection of SALOME data structure and OpenParts application data model
16 class NewGeom_EXPORT NewGeom_DataModel : public LightApp_DataModel
21 /// \param theModule a module instance
22 NewGeom_DataModel(NewGeom_Module* theModule);
23 virtual ~NewGeom_DataModel();
26 /// \param thePath a path to the directory
27 /// \param theStudy a current study
28 /// \param theFiles a list of files to open
29 virtual bool open(const QString& thePath, CAM_Study* theStudy, QStringList theFiles);
31 /// Save module data to file
32 /// \param theFiles list of created files
33 virtual bool save(QStringList& theFiles);
35 /// Save module data to a file
36 /// \param thePath a path to the directory
37 /// \param theStudy a current study
38 /// \param theFiles a list of files to open
39 virtual bool saveAs(const QString& thePath, CAM_Study* theStudy, QStringList& theFiles);
41 /// Close data structure
44 /// Create data structure
45 /// \param theStudy a current study
46 virtual bool create(CAM_Study* theStudy);
48 /// Returns True if the data structure has been modified
49 virtual bool isModified() const;
51 /// Returns True if the data structure is already saved
52 virtual bool isSaved() const;
54 /// Update data object
55 /// \param theObj an data object
56 /// \param theStudy a current study
57 virtual void update(LightApp_DataObject* theObj = 0, LightApp_Study* theStudy = 0);
61 * Removes the directory with content if it exists
62 * \param theDirectoryName a directory name
64 static void removeDirectory(const QString& theDirectoryName);
67 /// Pat to a study file
70 /// a path to the temporary directory, created by opening a document file
71 QString myTmpDirectory;
73 /// it should be created because the files reading is postponed in the module. The directory
74 // should be removed after the model document is closed.
75 NewGeom_Module* myModule;