Back to index

salome-med  6.5.0
MEDMEM_Med_i.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //=============================================================================
00024 // File      : MEDMEM_Med_i.hxx
00025 // Project   : SALOME
00026 // Author    : EDF
00027 //=============================================================================
00028 //
00029 #ifndef _MED_MED_I_HXX_
00030 #define _MED_MED_I_HXX_
00031 
00032 #include <MEDMEM_I.hxx>
00033 
00034 #include <string>
00035 
00036 #include <SALOMEconfig.h>
00037 
00038 #include "SALOME_GenericObj_i.hh"
00039 #include CORBA_SERVER_HEADER(MED)
00040 #include CORBA_SERVER_HEADER(SALOMEDS)
00041 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
00042 
00043 #include "MEDMEM_MedFileBrowser.hxx"
00044 #include "MEDMEM_GenDriver.hxx"
00045 
00046 namespace MEDMEM {
00047 typedef map<DT_IT_, SALOME_MED::FIELD_ptr, LT_DT_IT_ > MAP_IOR_DT_IT_;
00048   
00049 class GMESH;
00050 class FIELD_;
00051 
00052 class MEDMEM_I_EXPORT MED_i: public POA_SALOME_MED::MED,
00053              public SALOME::GenericObj_i
00054 {
00055 
00056 private :
00057 
00058 protected:
00059     // C++ object containing values
00060   MEDFILEBROWSER                 _med;
00061   map<string, ::MEDMEM::GMESH* > _medmem_meshes;
00062   vector< ::MEDMEM::FIELD_* >    _medmem_fields;
00063   string _medId;
00064 
00065   map<string,SALOME_MED::GMESH_ptr>    _meshes;   // We can't have two MESHes with the same name.  
00066 
00067   map<string,map<MED_EN::medEntityMesh,SALOME_MED::SUPPORT_ptr> > _supports; 
00068 
00069   map<string,MAP_IOR_DT_IT_>          _fields;   // We can't have two FIELDs with the same name. 
00070   
00071 public:
00072     // Constructors and associated internal methods
00073     MED_i();
00074     ~MED_i();
00075 
00076   // Analyse the file <fileName> by calling readFileStruct
00077   void init(SALOMEDS::Study_ptr myStudy, driverTypes driverType, const string & fileName);
00078 
00079   // Same method as above but with storage of fields with their type
00080   void initWithFieldType(SALOMEDS::Study_ptr myStudy, driverTypes driverType,
00081                          const string & fileName, bool persistence=false);
00082 
00083   void addInStudy(SALOMEDS::Study_ptr myStudy, SALOME_MED::MED_ptr myIor,
00084                   SALOMEDS::SComponent_ptr mySComp, const char * medObjName)
00085     throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
00086 
00087   SALOME_MED::SUPPORT_ptr getSupport(string                meshName,
00088                                      MED_EN::medEntityMesh entity,
00089                                      const string          name="")
00090     throw (SALOME::SALOME_Exception);
00091 
00092 
00093     // IDL Methods 
00094     CORBA::Long             getNumberOfMeshes() throw (SALOME::SALOME_Exception);
00095     CORBA::Long             getNumberOfFields() throw (SALOME::SALOME_Exception);
00096     SALOME_TYPES::ListOfString * getMeshNames()      throw (SALOME::SALOME_Exception);
00097     SALOME_TYPES::ListOfString * getFieldNames()     throw (SALOME::SALOME_Exception);
00098     SALOME_MED::GMESH_ptr    getMeshByName(const char* meshName) 
00099                                                 throw (SALOME::SALOME_Exception);
00100     SALOME_MED::GMESH_ptr    getMesh(SALOME_MED::FIELD_ptr fieldPtr) 
00101                                                 throw (SALOME::SALOME_Exception);
00102     CORBA::Long getFieldNumberOfIteration(const char* fieldName) 
00103       throw (SALOME::SALOME_Exception);
00104     SALOME_TYPES::ListOfLong * getFieldIteration(const char* fieldName, CORBA::Long i) 
00105       throw (SALOME::SALOME_Exception);
00106     SALOME_TYPES::ListOfLong * getFieldIterations(const char* fieldName) 
00107       throw (SALOME::SALOME_Exception);
00108     SALOME_MED::FIELD_ptr   getField(const char* fieldName,
00109                                      CORBA::Long pasTemps, 
00110                                      CORBA::Long numOrdre) 
00111                                                 throw (SALOME::SALOME_Exception);
00112     CORBA::Long             addDriver(SALOME_MED::medDriverTypes driverType, 
00113                                       const char* fileName) 
00114                                                 throw (SALOME::SALOME_Exception);
00115     void                    rmDriver(CORBA::Long i) 
00116                                                 throw (SALOME::SALOME_Exception);
00117     void                    readFileStruct(CORBA::Long i) 
00118                                                 throw (SALOME::SALOME_Exception);
00119     void                    writeFrom(CORBA::Long i) 
00120                                                 throw (SALOME::SALOME_Exception);
00121     void                    write(CORBA::Long i) 
00122                                                 throw (SALOME::SALOME_Exception);
00123     void                    addMesh(SALOME_MED::GMESH_ptr ptrMesh) 
00124                                                 throw (SALOME::SALOME_Exception);
00125     void                    addField(SALOME_MED::FIELD_ptr ptrField) 
00126                                                 throw (SALOME::SALOME_Exception);
00127     void                    addInStudy(SALOMEDS::Study_ptr myStudy,
00128                                        SALOME_MED::MED_ptr myIor) 
00129                                                 throw (SALOME::SALOME_Exception,
00130                                                        SALOMEDS::StudyBuilder::LockProtection);
00131 };
00132 }
00133 
00134 #endif /* _MED_MED_I_HXX_ */