]> SALOME platform Git repositories - modules/med.git/blob - src/MED/Med_Gen_i.hxx
Salome HOME
updating the main trunk with the CEA debug devellopment from the branch
[modules/med.git] / src / MED / Med_Gen_i.hxx
1 //  MED MED : implemetation of MED idl descriptions
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : Med_Gen_i.hxx
25 //  Author : Paul RASCLE, EDF
26 //  Module : MED
27 //  $Header$
28
29 #ifndef _MED_GEN_I_HXX_
30 #define _MED_GEN_I_HXX_
31
32 #include <SALOMEconfig.h>
33 #include <map>
34 #include CORBA_SERVER_HEADER(MED_Gen)
35 #include CORBA_SERVER_HEADER(MED)
36 #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
37
38 #include "SALOME_Component_i.hxx"
39 #include "SALOME_NamingService.hxx"
40
41 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
42
43 class Med_Gen_i:
44   public POA_SALOME_MED::MED_Gen,
45   public Engines_Component_i 
46 {
47 private:
48   SALOMEDS::Study_var studyName2Study(const char* studyName)
49     throw(SALOME::SALOME_Exception);
50   void addInStudy(SALOMEDS::Study_var myStudy)
51     throw(SALOME::SALOME_Exception);
52
53 public:
54   Med_Gen_i();
55   Med_Gen_i(CORBA::ORB_ptr orb,
56             PortableServer::POA_ptr poa,
57             PortableServer::ObjectId * contId, 
58             const char *instanceName, 
59             const char *interfaceName);
60   virtual ~Med_Gen_i();
61
62   //
63   SALOME_MED::MESH_ptr readMeshInFile(const char* fileName,
64                                       const char* studyName,
65                                       const char* meshName)
66   throw(SALOME::SALOME_Exception);
67
68   SALOME_MED::FIELD_ptr readFieldInFile(const char* fileName,
69                                       const char* studyName,
70                                       const char* fieldName,
71                                       CORBA::Long ordre,
72                                       CORBA::Long iter)
73   throw(SALOME::SALOME_Exception);
74
75   SALOME_MED::MED_ptr   readStructFile(const char* fileName,
76                                       const char* studyName)
77   throw(SALOME::SALOME_Exception);
78
79   void    readStructFileWithFieldType(const char* fileName,
80                                       const char* studyName)
81   throw(SALOME::SALOME_Exception);
82
83   // inherited methods from SALOMEDS::Driver
84
85 //    void Save(const char *IORSComponent, const char *aUrlOfFile);
86 //    void Load(const char *IORSComponent, const char *aUrlOfFile); 
87   SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
88                           const char* theURL,
89                           bool isMultiFile);
90   SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
91                                const char* theURL,
92                                bool isMultiFile);
93
94   CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
95                       const SALOMEDS::TMPFile& theStream,
96                       const char* theURL,
97                       bool isMultiFile);
98   CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent,
99                            const SALOMEDS::TMPFile& theStream,
100                            const char* theURL,
101                            bool isMultiFile);
102
103   void Close(SALOMEDS::SComponent_ptr theComponent);
104   char* ComponentDataType();
105     
106   char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
107                                const char* IORString,
108                                CORBA::Boolean isMultiFile,
109                                CORBA::Boolean isASCII);
110   char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
111                                const char* aLocalPersistentID,
112                                CORBA::Boolean isMultiFile,
113                                CORBA::Boolean isASCII)
114     throw(SALOME::SALOME_Exception);
115
116   bool CanPublishInStudy(CORBA::Object_ptr theIOR);
117
118   SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
119                                        SALOMEDS::SObject_ptr theSObject,
120                                        CORBA::Object_ptr theObject,
121                                        const char* theName) throw (SALOME::SALOME_Exception) ;
122
123   CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
124   SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
125   CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
126   SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
127                                   CORBA::Long theObjectID,
128                                   SALOMEDS::SObject_ptr theObject);
129   
130   private :
131   static std::map <std::string, std::string>_MedCorbaObj;
132   static std::string _myFileName;
133   static std::string _saveFileName;
134
135   private:
136   bool   _duringLoad;
137   int    _myStudyID;
138   std::string _myStudyName;
139   
140   int myCounter;
141   SALOME_NamingService *_NS;
142
143
144 };
145
146 #endif