00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __MEDFILEMESHELT_HXX__
00021 #define __MEDFILEMESHELT_HXX__
00022
00023 #include "MEDCouplingMemArray.hxx"
00024 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
00025
00026 #include "NormalizedUnstructuredMesh.hxx"
00027
00028 extern "C"
00029 {
00030 #include "med.h"
00031 }
00032
00033 namespace ParaMEDMEM
00034 {
00035 class MEDCouplingUMesh;
00036
00037 class MEDFileUMeshPerType : public RefCountObject
00038 {
00039 public:
00040 static MEDFileUMeshPerType *New(med_idt fid, const char *mName, int dt, int it, int mdim, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType geoElt2);
00041 static bool isExisting(med_idt fid, const char *mName, int dt, int it, med_geometry_type geoElt, med_entity_type& whichEntity);
00042 int getDim() const;
00043 const DataArrayInt *getNodal() const { return _conn; }
00044 const DataArrayInt *getNodalIndex() const { return _conn_index; }
00045 const DataArrayInt *getFam() const { return _fam; }
00046 const DataArrayInt *getNum() const { return _num; }
00047 static void write(med_idt fid, const char *mname, int mdim, const MEDCouplingUMesh *m, const DataArrayInt *fam, const DataArrayInt *num);
00048 private:
00049 MEDFileUMeshPerType(med_idt fid, const char *mName, int dt, int it, int mdim, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType type,
00050 med_entity_type entity);
00051 void loadFromStaticType(med_idt fid, const char *mName, int dt, int it, int mdim, int curNbOfElem, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType type,
00052 med_entity_type entity);
00053 void loadPolyg(med_idt fid, const char *mName, int dt, int it, int mdim, int arraySize, med_geometry_type geoElt,
00054 med_entity_type entity);
00055 void loadPolyh(med_idt fid, const char *mName, int dt, int it, int mdim, int connFaceLgth, med_geometry_type geoElt,
00056 med_entity_type entity);
00057 private:
00058 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _conn;
00059 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _conn_index;
00060 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num;
00061 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam;
00062 INTERP_KERNEL::NormalizedCellType _type;
00063 med_entity_type _entity;
00064 };
00065 }
00066
00067 #endif