]> SALOME platform Git repositories - modules/gui.git/blob - src/CAM/CAM_Study.h
Salome HOME
29106776b0a089491ae6b806f5831afc644bd47e
[modules/gui.git] / src / CAM / CAM_Study.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/
18 //
19 #ifndef CAM_STUDY_H
20 #define CAM_STUDY_H
21
22 #include "CAM.h"
23
24 #include "CAM_DataModel.h"
25
26 #include <SUIT_Study.h>
27
28 #include <qptrlist.h>
29
30 #ifdef WIN32
31 #pragma warning( disable:4251 )
32 #endif
33
34 class CAM_EXPORT CAM_Study : public SUIT_Study
35 {
36   Q_OBJECT
37
38 public:
39   typedef QPtrList<CAM_DataModel>         ModelList;
40   typedef QPtrListIterator<CAM_DataModel> ModelListIterator;
41
42 public:
43   CAM_Study( SUIT_Application* );
44   virtual ~CAM_Study();
45
46   virtual void closeDocument(bool permanently = true);
47
48   /** @name Insert data model methods.*/
49   //@{
50   bool         appendDataModel( const CAM_DataModel* );
51   virtual bool insertDataModel( const CAM_DataModel*, const int = -1 );
52   bool         insertDataModel( const CAM_DataModel*, const CAM_DataModel* );
53   //@}
54
55   virtual bool removeDataModel( const CAM_DataModel* );
56
57   bool         containsDataModel( const CAM_DataModel* ) const;
58
59   void         dataModels( ModelList& ) const;
60
61 protected:
62   virtual void dataModelInserted( const CAM_DataModel* );
63   virtual bool openDataModel( const QString&, CAM_DataModel* );
64   virtual bool saveDataModel( const QString&, CAM_DataModel* );
65
66 protected slots:
67   virtual void updateModelRoot( const CAM_DataModel* );
68
69 private:
70   //! Data model list
71   ModelList    myDataModels;
72 };
73
74 #ifdef WIN32
75 #pragma warning( default:4251 )
76 #endif
77
78 #endif