1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, 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.
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
22 // MED MED : implemetation of MED idl descriptions
23 // File : Med_Gen_i.hxx
24 // Author : Paul RASCLE, EDF
27 #ifndef _MED_GEN_I_HXX_
28 #define _MED_GEN_I_HXX_
30 #include <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(MED_Gen)
33 #include CORBA_SERVER_HEADER(MED)
34 #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
36 #include "SALOME_Component_i.hxx"
37 #include "SALOME_NamingService.hxx"
39 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
41 #include "Med_Gen_Driver_i.hxx"
48 #if defined MED_EXPORTS
50 #define MED_EXPORT __declspec( dllexport )
56 #define MED_EXPORT __declspec( dllimport )
65 class MED_EXPORT Med_Gen_i:
66 public POA_SALOME_MED::MED_Gen,
67 public Engines_Component_i,
68 public Med_Gen_Driver_i
71 SALOMEDS::Study_var studyName2Study(const char* studyName)
72 throw(SALOME::SALOME_Exception);
73 void addInStudy(SALOMEDS::Study_var myStudy)
74 throw(SALOME::SALOME_Exception);
78 Med_Gen_i(CORBA::ORB_ptr orb,
79 PortableServer::POA_ptr poa,
80 PortableServer::ObjectId * contId,
81 const char *instanceName,
82 const char *interfaceName);
86 SALOME_MED::MESH_ptr readMeshInFile(const char* fileName,
87 const char* studyName,
89 throw(SALOME::SALOME_Exception);
91 SALOME_MED::FIELD_ptr readFieldInFile(const char* fileName,
92 const char* studyName,
93 const char* fieldName,
96 throw(SALOME::SALOME_Exception);
98 SALOME_MED::MED_ptr readStructFile(const char* fileName,
99 const char* studyName)
100 throw(SALOME::SALOME_Exception);
102 void readStructFileWithFieldType(const char* fileName,
103 const char* studyName)
104 throw(SALOME::SALOME_Exception);
106 // Get last created instance of the class
107 static Med_Gen_i* GetMEDGen() { return _MEDGen; }
109 // Get Med of the study (for persistance)
110 static SALOME_MED::MED_ptr GetMED(SALOMEDS::SComponent_ptr theStudy);
112 // Get object of the CORBA reference
113 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
116 static T DownCast(CORBA::Object_ptr theArg)
118 return dynamic_cast<T>(GetServant(theArg).in());
121 // (re)defined methods of Driver
122 char* ComponentDataType();
123 virtual Engines::Component_ptr GetComponentInstance();
126 //static std::string _myFileName;
127 //static std::string _saveFileName;
128 static Med_Gen_i* _MEDGen; // Point to last created instance of the class
133 //std::string _myStudyName;