1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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, or (at your option) any later version.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef SALOMEAPP_STUDY_H
24 #define SALOMEAPP_STUDY_H
26 #include "SalomeApp.h"
28 #include <LightApp_Study.h>
31 #pragma warning( disable:4251 )
34 #include "SALOMEDSClient.hxx"
36 class SALOMEAPP_EXPORT SalomeApp_Study : public LightApp_Study
43 SalomeApp_Study( SUIT_Application* );
44 virtual ~SalomeApp_Study();
46 virtual int id() const;
47 virtual QString studyName() const;
49 virtual bool createDocument( const QString& );
50 virtual bool openDocument( const QString& );
51 virtual bool loadDocument( const QString& );
53 virtual bool saveDocument();
54 virtual bool saveDocumentAs( const QString& );
56 virtual void closeDocument(bool permanently = true);
58 virtual bool dump( const QString&, bool, bool, bool );
60 virtual bool isSaved() const;
61 virtual bool isModified() const;
62 virtual void Modified();
64 virtual void addComponent ( const CAM_DataModel* dm);
66 _PTR(Study) studyDS() const;
68 virtual std::string GetTmpDir ( const char* theURL, const bool isMultiFile);
70 // to delete all references to object, whose have the same component
71 void deleteReferencesTo( _PTR( SObject ) );
73 virtual QString componentDataType( const QString& ) const;
74 virtual QString referencedToEntry( const QString& ) const;
75 virtual bool isComponent( const QString& ) const;
76 virtual void children( const QString&, QStringList& ) const;
77 virtual void components( QStringList& ) const;
78 virtual QString centry( const QString& ) const;
80 std::vector<int> getSavePoints();
81 void removeSavePoint(int savePoint);
82 QString getNameOfSavePoint(int savePoint);
83 void setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint);
85 virtual void restoreState(int savePoint);
86 #ifndef DISABLE_PYCONSOLE
87 void updateFromNotebook(const QString&, bool);
90 virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry );
93 virtual void saveModuleData ( QString theModuleName, QStringList theListOfFiles );
94 virtual void openModuleData ( QString theModuleName, QStringList& theListOfFiles );
95 virtual bool saveStudyData ( const QString& theFileName );
96 virtual bool openStudyData ( const QString& theFileName );
98 virtual std::vector<std::string> GetListOfFiles ( const char* theModuleName ) const;
99 virtual void SetListOfFiles ( const char* theModuleName,
100 const std::vector<std::string> theListOfFiles);
101 virtual void RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile) const;
104 virtual void dataModelInserted( const CAM_DataModel* );
105 virtual bool openDataModel( const QString&, CAM_DataModel* );
106 void setStudyDS(const _PTR(Study)& s );
107 virtual CAM_ModuleObject* createModuleObject( LightApp_DataModel* theDataModel,
108 SUIT_DataObject* theParent ) const;
110 virtual void updateModelRoot( const CAM_DataModel* );
111 #ifndef DISABLE_PYCONSOLE
112 void onNoteBookVarUpdate( QString theVarName );
116 QString newStudyName() const;
119 _PTR(Study) myStudyDS;
120 Observer_i* myObserver;
122 #ifndef DISABLE_PYCONSOLE
124 void notebookVarUpdated( QString theVarName );
129 #pragma warning( default:4251 )