]> SALOME platform Git repositories - modules/med.git/blob - src/MED/Med_Gen_i.hxx
Salome HOME
NRI : Update 1.1a and New organisation.
[modules/med.git] / src / MED / Med_Gen_i.hxx
1 //=============================================================================
2 // File      : Med_Gen_i.hxx
3 // Created   : mer fév 20 15:47:52 CET 2002
4 // Author    : Paul RASCLE, EDF
5 // Project   : SALOME
6 // Copyright : EDF 2001
7 // $Header$
8 //=============================================================================
9
10 #ifndef _MED_GEN_I_HXX_
11 #define _MED_GEN_I_HXX_
12
13 #include <SALOMEconfig.h>
14 #include <map>
15 #include CORBA_SERVER_HEADER(Med_Gen)
16 #include CORBA_SERVER_HEADER(MED)
17
18 #include "SALOME_Component_i.hxx"
19 #include "SALOME_NamingService.hxx"
20
21 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
22
23 class Med_Gen_i:
24   public POA_Engines::Med_Gen,
25   public Engines_Component_i 
26 {
27 private:
28   SALOMEDS::Study_var studyName2Study(const char* studyName)
29     throw(SALOME::SALOME_Exception);
30   void addInStudy(SALOMEDS::Study_var myStudy)
31     throw(SALOME::SALOME_Exception);
32
33 public:
34   Med_Gen_i();
35   Med_Gen_i(CORBA::ORB_ptr orb,
36             PortableServer::POA_ptr poa,
37             PortableServer::ObjectId * contId, 
38             const char *instanceName, 
39             const char *interfaceName);
40   virtual ~Med_Gen_i();
41
42   //
43   SALOME_MED::MESH_ptr readMeshInFile(const char* fileName,
44                                       const char* studyName,
45                                       const char* meshName)
46   throw(SALOME::SALOME_Exception);
47
48   SALOME_MED::FIELD_ptr readFieldInFile(const char* fileName,
49                                       const char* studyName,
50                                       const char* fieldName,
51                                       CORBA::Long ordre,
52                                       CORBA::Long iter)
53   throw(SALOME::SALOME_Exception);
54
55   SALOME_MED::MED_ptr   readStructFile(const char* fileName,
56                                       const char* studyName)
57   throw(SALOME::SALOME_Exception);
58
59   void    readStructFileWithFieldType(const char* fileName,
60                                       const char* studyName)
61   throw(SALOME::SALOME_Exception);
62
63   // inherited methods from SALOMEDS::Driver
64
65 //    void Save(const char *IORSComponent, const char *aUrlOfFile);
66 //    void Load(const char *IORSComponent, const char *aUrlOfFile); 
67   SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
68                           const char* theURL,
69                           bool isMultiFile);
70
71   CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
72                       const SALOMEDS::TMPFile& theStream,
73                       const char* theURL,
74                       bool isMultiFile);
75
76   void Close(SALOMEDS::SComponent_ptr theComponent);
77   char* ComponentDataType();
78     
79   char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
80                                const char* IORString,
81                                CORBA::Boolean isMultiFile);
82   char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
83                                const char* aLocalPersistentID,
84                                CORBA::Boolean isMultiFile)
85     throw(SALOME::SALOME_Exception);
86
87   bool CanPublishInStudy(CORBA::Object_ptr theIOR);
88
89   SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
90                                        SALOMEDS::SObject_ptr theSObject,
91                                        CORBA::Object_ptr theObject,
92                                        const char* theName) throw (SALOME::SALOME_Exception) ;
93
94   CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
95   SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
96   CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
97   SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
98                                   CORBA::Long theObjectID,
99                                   SALOMEDS::SObject_ptr theObject);
100   
101   private :
102   static map <string, string>_MedCorbaObj;
103   static string _myFileName;
104   static string _saveFileName;
105
106   private:
107   bool   _duringLoad;
108   int    _myStudyID;
109   string _myStudyName;
110   
111   int myCounter;
112   SALOME_NamingService *_NS;
113
114
115 };
116
117 #endif