1 // Copyright (C) 2007-2023 CEA, EDF, 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 SALOMEAPPIMPL_EXPORT SalomeApp_Study : public LightApp_Study
43 SalomeApp_Study( SUIT_Application* );
44 virtual ~SalomeApp_Study();
46 virtual QString studyName() const;
48 virtual bool createDocument( const QString& );
49 virtual bool openDocument( const QString& );
50 virtual bool loadDocument( const QString& );
52 virtual bool saveDocument();
53 virtual bool saveDocumentAs( const QString& );
55 virtual void closeDocument(bool permanently = true);
57 virtual bool dump( const QString&, bool, bool, bool );
59 virtual bool isSaved() const;
60 virtual bool isModified() const;
61 virtual void Modified();
63 virtual void addComponent ( const CAM_DataModel* dm);
65 _PTR(Study) studyDS() const;
67 virtual std::string GetTmpDir ( const char* theURL, const bool isMultiFile);
69 // to delete all references to object, whose have the same component
70 void deleteReferencesTo( _PTR( SObject ) );
72 virtual QString componentDataType( const QString& ) const;
73 virtual QString referencedToEntry( const QString& ) const;
74 virtual bool isComponent( const QString& ) const;
75 virtual void children( const QString&, QStringList& ) const;
76 virtual void components( QStringList& ) const;
77 virtual QString centry( const QString& ) const;
79 std::vector<int> getSavePoints();
80 void removeSavePoint(int savePoint);
81 QString getNameOfSavePoint(int savePoint);
82 void setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint);
84 virtual void restoreState(int savePoint);
85 #ifndef DISABLE_PYCONSOLE
86 void updateFromNotebook(const QString&, bool);
89 virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry );
91 virtual void RemoveTemporaryFiles ( const char*, bool, bool = false );
94 virtual void saveModuleData ( QString theModuleName, int type, QStringList theListOfFiles );
95 virtual void openModuleData ( QString theModuleName, int type, QStringList& theListOfFiles );
96 virtual bool saveStudyData ( const QString& theFileName, int type );
97 virtual bool openStudyData ( const QString& theFileName, int type );
99 virtual std::vector<std::string> GetListOfFiles ( const char* theModuleName, int type ) const;
100 virtual void SetListOfFiles ( const char* theModuleName, int type,
101 const std::vector<std::string> theListOfFiles);
104 virtual void dataModelInserted( const CAM_DataModel* );
105 virtual bool openDataModel( const QString&, CAM_DataModel* );
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 _PTR(Study) myStudyDS;
117 Observer_i* myObserver;
119 #ifndef DISABLE_PYCONSOLE
121 void notebookVarUpdated( QString theVarName );
126 #pragma warning( default:4251 )