Salome HOME
e710026de036bdd0ea70b2dbc28fbb4207000a99
[samples/atomic.git] / ATOMIC_SRC / src / ATOMICGUI / ATOMICGUI_DataModel.h
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21
22 #if !defined(ATOMICGUI_DATAMODEL_H)
23 #define ATOMICGUI_DATAMODEL_H
24
25 #include "ATOMICGUI_Data.h"
26 #include <LightApp_DataModel.h>
27 #include <qlist.h>
28
29 class CAM_Module;
30 class LightApp_Study;
31 class LightApp_DataObject;
32 class ATOMICGUI_DataObject;
33
34 /*!
35  * Class       : ATOMICGUI_DataModel
36  * Description : Data Model of ATOMIC component
37  */
38 class ATOMICGUI_DataModel : public LightApp_DataModel
39 {
40   Q_OBJECT
41
42 public:
43   ATOMICGUI_DataModel ( CAM_Module* );
44   virtual ~ATOMICGUI_DataModel();
45
46   virtual bool          open   ( const QString&, CAM_Study*, QStringList );
47   virtual bool          save   ( QStringList& );
48   virtual bool          saveAs ( const QString&, CAM_Study*, QStringList& );
49   virtual bool          close  ();
50   virtual bool          create ( CAM_Study* );
51
52   virtual bool          isModified () const;
53   virtual bool          isSaved    () const;
54
55   bool                  importFile ( const QString&, CAM_Study* = 0 );
56   bool                  exportFile ( const QString& = QString::null );
57   bool                  createMolecule ();
58   bool                  addAtom    ( const QString&, const QString&, 
59                                      const double, const double, const double );
60   bool                  renameObj  ( const QString&, const QString& );
61   bool                  deleteObjs ( const QStringList& );
62
63   ATOMICGUI_DataObject* findObject   ( const QString& ); 
64   ATOMICGUI_DataObject* findMolecule ( const QString& ); 
65
66 protected:
67   virtual void          build();
68
69 private:
70   QString                              myStudyURL;
71   QList<ATOMICGUI_AtomicMolecule>      myMolecules;
72 };
73
74 #endif // ATOMICGUI_DATAMODEL_H