Version: 6.3.1

src/SalomeApp/SalomeApp_Study.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef SALOMEAPP_STUDY_H
00024 #define SALOMEAPP_STUDY_H
00025 
00026 #include "SalomeApp.h"
00027 
00028 #include <LightApp_Study.h>
00029 
00030 #ifdef WIN32
00031 #pragma warning( disable:4251 )
00032 #endif
00033 
00034 #include "SALOMEDSClient.hxx"
00035 
00036 class SALOMEAPP_EXPORT SalomeApp_Study : public LightApp_Study
00037 {
00038   Q_OBJECT
00039 
00040   class Observer_i;
00041 
00042 public:
00043   SalomeApp_Study( SUIT_Application* );
00044   virtual ~SalomeApp_Study();
00045 
00046   virtual int         id() const;
00047   virtual QString     studyName() const;
00048 
00049   virtual bool        createDocument( const QString& );
00050   virtual bool        openDocument( const QString& );
00051   virtual bool        loadDocument( const QString& );
00052 
00053   virtual bool        saveDocument();
00054   virtual bool        saveDocumentAs( const QString& );
00055 
00056   virtual void        closeDocument(bool permanently = true);
00057 
00058   virtual bool        isSaved()  const;
00059   virtual bool        isModified() const;
00060   virtual void        Modified();
00061 
00062   virtual void        addComponent   ( const CAM_DataModel* dm);
00063 
00064   _PTR(Study)         studyDS() const;
00065 
00066   virtual std::string GetTmpDir      ( const char* theURL, const bool  isMultiFile);
00067 
00068   // to delete all references to object, whose have the same component
00069   void                deleteReferencesTo( _PTR( SObject ) );
00070 
00071   virtual QString     componentDataType( const QString& ) const;
00072   virtual QString     referencedToEntry( const QString& ) const;
00073   virtual bool        isComponent( const QString& ) const;
00074   virtual void        children( const QString&, QStringList& ) const;
00075   virtual void        components( QStringList& ) const;
00076   virtual QString     centry( const QString& ) const;
00077 
00078   std::vector<int>    getSavePoints();
00079   void                removeSavePoint(int savePoint);
00080   QString             getNameOfSavePoint(int savePoint);
00081   void                setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint);
00082 
00083   virtual void        restoreState(int savePoint);
00084   void                markAsSavedIn(QString theFileName);
00085 
00086   virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry );
00087 
00088 protected:
00089   virtual void        saveModuleData ( QString theModuleName, QStringList theListOfFiles );
00090   virtual void        openModuleData ( QString theModuleName, QStringList& theListOfFiles );
00091   virtual bool        saveStudyData  (  const QString& theFileName );
00092   virtual bool        openStudyData  ( const QString& theFileName );
00093 
00094   virtual std::vector<std::string> GetListOfFiles ( const char* theModuleName ) const;
00095   virtual void        SetListOfFiles ( const char* theModuleName,
00096                                        const std::vector<std::string> theListOfFiles);
00097   virtual void        RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile) const;
00098 
00099 protected:
00100   virtual void        dataModelInserted( const CAM_DataModel* );
00101   virtual bool        openDataModel( const QString&, CAM_DataModel* );
00102   void                setStudyDS(const _PTR(Study)& s );
00103 
00104 protected slots:
00105   virtual void        updateModelRoot( const CAM_DataModel* );
00106 
00107 private:
00108   QString             newStudyName() const;
00109 
00110 private:
00111   _PTR(Study)         myStudyDS;
00112   Observer_i*         myObserver;
00113 };
00114 
00115 #ifdef WIN32
00116 #pragma warning( default:4251 )
00117 #endif
00118 
00119 #endif 
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS