src/CAM/CAM_Study.h

Go to the documentation of this file.
00001 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
00002 // 
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either 
00006 // version 2.1 of the License.
00007 // 
00008 // This library is distributed in the hope that it will be useful 
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public  
00014 // License along with this library; if not, write to the Free Software 
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 #ifndef CAM_STUDY_H
00020 #define CAM_STUDY_H
00021 
00022 #include "CAM.h"
00023 
00024 #include "CAM_DataModel.h"
00025 
00026 #include <SUIT_Study.h>
00027 
00028 #include <qptrlist.h>
00029 
00030 #ifdef WIN32
00031 #pragma warning( disable:4251 )
00032 #endif
00033 
00040 class CAM_EXPORT CAM_Study : public SUIT_Study
00041 {
00042   Q_OBJECT
00043 
00044 public:
00045   typedef QPtrList<CAM_DataModel>         ModelList;
00046   typedef QPtrListIterator<CAM_DataModel> ModelListIterator;
00047 
00048 public:
00049   CAM_Study( SUIT_Application* );
00050   virtual ~CAM_Study();
00051 
00052   virtual void closeDocument(bool permanently = true);
00053 
00056   bool         appendDataModel( const CAM_DataModel* );
00057   virtual bool insertDataModel( const CAM_DataModel*, const int = -1 );
00058   bool         insertDataModel( const CAM_DataModel*, const CAM_DataModel* );
00060 
00061   virtual bool removeDataModel( const CAM_DataModel* );
00062 
00063   bool         containsDataModel( const CAM_DataModel* ) const;
00064 
00065   void         dataModels( ModelList& ) const;
00066 
00067 protected:
00068   virtual void dataModelInserted( const CAM_DataModel* );
00069   virtual bool openDataModel( const QString&, CAM_DataModel* );
00070   virtual bool saveDataModel( const QString&, CAM_DataModel* );
00071 
00072 protected slots:
00073   virtual void updateModelRoot( const CAM_DataModel* );
00074 
00075 private:
00077   ModelList    myDataModels;
00078 };
00079 
00080 #ifdef WIN32
00081 #pragma warning( default:4251 )
00082 #endif
00083 
00084 #endif