1 // SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
3 // Copyright (C) 2003 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.
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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOMEDS_StudyManager_i.hxx
25 // Author : Yves FRICAUD
29 #ifndef __SALOMEDS_STUDYMANAGER_I_H__
30 #define __SALOMEDS_STUDYMANAGER_I_H__
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SALOMEDS)
40 #include "SALOMEDS_OCAFApplication.hxx"
41 #include <TDocStd_Document.hxx>
42 #include <TDF_Attribute.hxx>
43 #include <TDataStd_Name.hxx>
44 #include <TDF_Label.hxx>
45 #include <TDocStd_Document.hxx>
47 // Naming Service header
48 #include "SALOME_NamingService.hxx"
55 //Standard not implemented
56 #include <Standard_NotImplemented.hxx>
59 class SALOMEDS_StudyManager_i: public POA_SALOMEDS::StudyManager,
60 public PortableServer::RefCountServantBase {
64 Handle (SALOMEDS_OCAFApplication) _OCAFApp;
65 SALOME_NamingService* _name_service;
67 Handle(TDocStd_Document) _clipboard;
69 // _SaveAs private function called by Save and SaveAs
70 virtual void _SaveAs(const char* aUrl,
71 SALOMEDS::Study_ptr aStudy,
72 CORBA::Boolean theMultiFile,
73 CORBA::Boolean theASCII);
74 // _SaveObject private function called by _SaveAs
75 virtual void _SaveObject(SALOMEDS::Study_ptr aStudy,
76 SALOMEDS::SObject_ptr SC,
77 HDFgroup *hdf_group_datatype);
78 // _SubstituteSlash function called by Open and GetStudyByName
79 virtual const char *_SubstituteSlash(const char *aUrl);
81 virtual void _SaveProperties(SALOMEDS::Study_ptr aStudy, HDFgroup *hdf_group);
85 //! standard constructor
86 SALOMEDS_StudyManager_i(CORBA::ORB_ptr orb);
88 //! standard destructor
89 virtual ~SALOMEDS_StudyManager_i();
91 //! method to Register study Manager in the naming service
93 \param char* arguments, the context to register the study manager in the NS
95 void register_name(char * name);
97 //! method to Create a New Study of name study_name
99 \param char* arguments, the new study name
100 \return Study_ptr arguments
102 virtual SALOMEDS::Study_ptr NewStudy(const char* study_name);
104 //! method to Open a Study from it's persistent reference
106 \param char* arguments, the study URL
107 \return Study_ptr arguments
109 virtual SALOMEDS::Study_ptr Open(const char* aStudyUrl) throw (SALOME::SALOME_Exception);
112 //! method to close a Study
114 \param Study_ptr arguments
116 virtual void Close( SALOMEDS::Study_ptr aStudy);
118 //! method to save a Study
120 \param Study_ptr arguments
122 virtual void Save( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
124 virtual void SaveASCII( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
126 //! method to save a Study to the persistent reference aUrl
128 \param char* arguments, the new URL of the study
129 \param Study_ptr arguments
131 virtual void SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
132 virtual void SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
134 //! method to Get name list of open studies in the session
136 \return ListOfOpenStudies* arguments
138 virtual SALOMEDS::ListOfOpenStudies* GetOpenStudies();
140 //! method to get a Study from it's name
142 \param char* arguments, the study name
143 \return Study_ptr arguments
145 virtual SALOMEDS::Study_ptr GetStudyByName(const char* aStudyName) ;
147 //! method to get a Study from it's ID
149 \param char* arguments, the study ID
150 \return Study_ptr arguments
152 virtual SALOMEDS::Study_ptr GetStudyByID(CORBA::Short aStudyID) ;
155 Handle(TDocStd_Document) GetDocumentOfStudy(SALOMEDS::Study_ptr theStudy);
157 void CopyLabel(const SALOMEDS::Study_ptr theSourceStudy,
158 const SALOMEDS::Driver_ptr theEngine,
159 const Standard_Integer theSourceStartDepth,
160 const TDF_Label& theSource,
161 const TDF_Label& theDestinationMain);
163 TDF_Label PasteLabel(const SALOMEDS::Study_ptr theDestinationStudy,
164 const SALOMEDS::Driver_ptr theEngine,
165 const TDF_Label& theSource,
166 const TDF_Label& theDestinationStart,
167 const int theCopiedStudyID,
168 const bool isFirstElement);
170 virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
171 virtual CORBA::Boolean Copy(SALOMEDS::SObject_ptr theObject);
172 virtual CORBA::Boolean CanPaste(SALOMEDS::SObject_ptr theObject);
173 virtual SALOMEDS::SObject_ptr Paste(SALOMEDS::SObject_ptr theObject) throw(SALOMEDS::StudyBuilder::LockProtection);