Back to index

salome-med  6.5.0
MEDFileMeshElt.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
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 #include "med.h"
00029 
00030 namespace ParaMEDMEM
00031 {
00032   class MEDCouplingUMesh;
00033 
00034   class MEDFileUMeshPerType : public RefCountObject
00035   {
00036   public:
00037     static MEDFileUMeshPerType *New(med_idt fid, const char *mName, int dt, int it, int mdim, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType geoElt2);
00038     static bool isExisting(med_idt fid, const char *mName, int dt, int it, med_geometry_type geoElt, med_entity_type& whichEntity);
00039     int getDim() const;
00040     const DataArrayInt *getNodal() const { return _conn; }
00041     const DataArrayInt *getNodalIndex() const { return _conn_index; }
00042     const DataArrayInt *getFam() const { return _fam; }
00043     const DataArrayInt *getNum() const { return _num; }
00044     static void write(med_idt fid, const char *mname, int mdim, const MEDCouplingUMesh *m, const DataArrayInt *fam, const DataArrayInt *num);
00045   private:
00046     MEDFileUMeshPerType(med_idt fid, const char *mName, int dt, int it, int mdim, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType type,
00047                         med_entity_type entity);
00048     void loadFromStaticType(med_idt fid, const char *mName, int dt, int it, int mdim, int curNbOfElem, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType type,
00049                             med_entity_type entity);
00050     void loadPolyg(med_idt fid, const char *mName, int dt, int it, int mdim, int arraySize, med_geometry_type geoElt,
00051                    med_entity_type entity);
00052     void loadPolyh(med_idt fid, const char *mName, int dt, int it, int mdim, int connFaceLgth, med_geometry_type geoElt,
00053                    med_entity_type entity);
00054   private:
00055     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _conn;
00056     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _conn_index;
00057     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num;
00058     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam;
00059     INTERP_KERNEL::NormalizedCellType _type;
00060     med_entity_type _entity;
00061   };
00062 }
00063 
00064 #endif