1 // Copyright (C) 2007-2012 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
23 // MED MED : implemetation of MED idl descriptions
24 // File : Med_Gen_i.hxx
25 // Author : Paul RASCLE, EDF
28 #ifndef _MED_GEN_I_HXX_
29 #define _MED_GEN_I_HXX_
31 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(MED_Gen)
34 #include CORBA_SERVER_HEADER(MED)
35 #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
37 #include "SALOME_Component_i.hxx"
38 #include "SALOME_NamingService.hxx"
40 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
42 #include "Med_Gen_Driver_i.hxx"
49 #if defined MED_EXPORTS || defined MEDEngine_EXPORTS
51 #define MED_EXPORT __declspec( dllexport )
57 #define MED_EXPORT __declspec( dllimport )
66 class MED_EXPORT Med_Gen_i:
67 public POA_SALOME_MED::MED_Gen,
68 public Engines_Component_i,
69 public Med_Gen_Driver_i
72 SALOMEDS::Study_var studyName2Study(const char* studyName)
73 throw(SALOME::SALOME_Exception);
74 void addInStudy(SALOMEDS::Study_var myStudy)
75 throw(SALOME::SALOME_Exception);
79 Med_Gen_i(CORBA::ORB_ptr orb,
80 PortableServer::POA_ptr poa,
81 PortableServer::ObjectId * contId,
82 const char *instanceName,
83 const char *interfaceName);
87 SALOME_MED::GMESH_ptr readMeshInFile(const char* fileName,
88 const char* studyName,
90 throw(SALOME::SALOME_Exception);
92 SALOME_MED::FIELD_ptr readFieldInFile(const char* fileName,
93 const char* studyName,
94 const char* fieldName,
97 throw(SALOME::SALOME_Exception);
99 SALOME_MED::MED_ptr readStructFile(const char* fileName,
100 const char* studyName)
101 throw(SALOME::SALOME_Exception);
103 void readStructFileWithFieldType(const char* fileName,
104 const char* studyName)
105 throw(SALOME::SALOME_Exception);
107 // Get last created instance of the class
108 static Med_Gen_i* GetMEDGen() { return _MEDGen; }
110 // Get Med of the study (for persistance)
111 static SALOME_MED::MED_ptr GetMED(SALOMEDS::SComponent_ptr theStudy);
113 // Get object of the CORBA reference
114 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
117 static T DownCast(CORBA::Object_ptr theArg)
119 return dynamic_cast<T>(GetServant(theArg).in());
122 // (re)defined methods of Driver
123 char* ComponentDataType();
124 virtual Engines::EngineComponent_ptr GetComponentInstance();
127 //static std::string _myFileName;
128 //static std::string _saveFileName;
129 static Med_Gen_i* _MEDGen; // Point to last created instance of the class
134 //std::string _myStudyName;