1 // File : SALOMEDS_StudyManager_i.hxx
2 // Created : Wed Nov 28 16:27:08 2001
3 // Author : Yves FRICAUD
7 // Copyright : Open CASCADE 2001
10 #ifndef __SALOMEDS_STUDYMANAGER_I_H__
11 #define __SALOMEDS_STUDYMANAGER_I_H__
17 #include <SALOMEconfig.h>
18 #include CORBA_SERVER_HEADER(SALOMEDS)
21 #include "SALOMEDS_OCAFApplication.hxx"
22 #include <TDocStd_Document.hxx>
23 #include <TDF_Attribute.hxx>
24 #include <TDataStd_Name.hxx>
25 #include <TDF_Label.hxx>
26 #include <TDocStd_Document.hxx>
28 // Naming Service header
29 #include "SALOME_NamingService.hxx"
36 //Standard not implemented
37 #include <Standard_NotImplemented.hxx>
40 class SALOMEDS_StudyManager_i: public POA_SALOMEDS::StudyManager,
41 public PortableServer::RefCountServantBase {
45 Handle (SALOMEDS_OCAFApplication) _OCAFApp;
46 SALOME_NamingService* _name_service;
48 Handle(TDocStd_Document) _clipboard;
50 // _SaveAs private function called by Save and SaveAs
51 virtual void _SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
52 // _SaveObject private function called by _SaveAs
53 virtual void _SaveObject(SALOMEDS::Study_ptr aStudy,
54 SALOMEDS::SObject_ptr SC,
55 HDFgroup *hdf_group_datatype);
56 // _SubstituteSlash function called by Open and GetStudyByName
57 virtual const char *_SubstituteSlash(const char *aUrl);
59 virtual void _SaveProperties(SALOMEDS::Study_ptr aStudy, HDFgroup *hdf_group);
63 //! standard constructor
64 SALOMEDS_StudyManager_i(CORBA::ORB_ptr orb);
66 //! standard destructor
67 virtual ~SALOMEDS_StudyManager_i();
69 //! method to Register study Manager in the naming service
71 \param char* arguments, the context to register the study manager in the NS
73 void register_name(char * name);
75 //! method to Create a New Study of name study_name
77 \param char* arguments, the new study name
78 \return Study_ptr arguments
80 virtual SALOMEDS::Study_ptr NewStudy(const char* study_name);
82 //! method to Open a Study from it's persistent reference
84 \param char* arguments, the study URL
85 \return Study_ptr arguments
87 virtual SALOMEDS::Study_ptr Open(const char* aStudyUrl) throw (SALOME::SALOME_Exception);
90 //! method to close a Study
92 \param Study_ptr arguments
94 virtual void Close( SALOMEDS::Study_ptr aStudy);
96 //! method to save a Study
98 \param Study_ptr arguments
100 virtual void Save( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
102 //! method to save a Study to the persistent reference aUrl
104 \param char* arguments, the new URL of the study
105 \param Study_ptr arguments
107 virtual void SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile);
109 //! method to Get name list of open studies in the session
111 \return ListOfOpenStudies* arguments
113 virtual SALOMEDS::ListOfOpenStudies* GetOpenStudies();
115 //! method to get a Study from it's name
117 \param char* arguments, the study name
118 \return Study_ptr arguments
120 virtual SALOMEDS::Study_ptr GetStudyByName(const char* aStudyName) ;
122 //! method to get a Study from it's ID
124 \param char* arguments, the study ID
125 \return Study_ptr arguments
127 virtual SALOMEDS::Study_ptr GetStudyByID(CORBA::Short aStudyID) ;
130 Handle(TDocStd_Document) GetDocumentOfStudy(SALOMEDS::Study_ptr theStudy);
132 void CopyLabel(const SALOMEDS::Study_ptr theSourceStudy,
133 const SALOMEDS::Driver_ptr theEngine,
134 const Standard_Integer theSourceStartDepth,
135 const TDF_Label& theSource,
136 const TDF_Label& theDestinationMain);
138 TDF_Label PasteLabel(const SALOMEDS::Study_ptr theDestinationStudy,
139 const SALOMEDS::Driver_ptr theEngine,
140 const TDF_Label& theSource,
141 const TDF_Label& theDestinationStart,
142 const int theCopiedStudyID,
143 const bool isFirstElement);
145 virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
146 virtual CORBA::Boolean Copy(SALOMEDS::SObject_ptr theObject);
147 virtual CORBA::Boolean CanPaste(SALOMEDS::SObject_ptr theObject);
148 virtual SALOMEDS::SObject_ptr Paste(SALOMEDS::SObject_ptr theObject) throw(SALOMEDS::StudyBuilder::LockProtection);