]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDLoader/MEDFileMeshElt.hxx
Salome HOME
7cf22da69748a5752ee6e7b74948971b4e2802f2
[tools/medcoupling.git] / src / MEDLoader / MEDFileMeshElt.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __MEDFILEMESHELT_HXX__
21 #define __MEDFILEMESHELT_HXX__
22
23 #include "MEDCouplingMemArray.hxx"
24 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
25
26 #include "NormalizedUnstructuredMesh.hxx"
27
28 #include "med.h"
29
30 namespace ParaMEDMEM
31 {
32   class MEDCouplingUMesh;
33
34   class MEDFileUMeshPerType : public RefCountObject
35   {
36   public:
37     static MEDFileUMeshPerType *New(med_idt fid, const char *mName, int dt, int it, int mdim, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType geoElt2);
38     static bool isExisting(med_idt fid, const char *mName, int dt, int it, med_geometry_type geoElt, med_entity_type& whichEntity);
39     int getDim() const;
40     const DataArrayInt *getNodal() const { return _conn; }
41     const DataArrayInt *getNodalIndex() const { return _conn_index; }
42     const DataArrayInt *getFam() const { return _fam; }
43     const DataArrayInt *getNum() const { return _num; }
44     static void write(med_idt fid, const char *mname, int mdim, const MEDCouplingUMesh *m, const DataArrayInt *fam, const DataArrayInt *num);
45   private:
46     MEDFileUMeshPerType(med_idt fid, const char *mName, int dt, int it, int mdim, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType type,
47                         med_entity_type entity);
48     void loadFromStaticType(med_idt fid, const char *mName, int dt, int it, int mdim, int curNbOfElem, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType type,
49                             med_entity_type entity);
50     void loadPolyg(med_idt fid, const char *mName, int dt, int it, int mdim, int arraySize, med_geometry_type geoElt,
51                    med_entity_type entity);
52     void loadPolyh(med_idt fid, const char *mName, int dt, int it, int mdim, int connFaceLgth, med_geometry_type geoElt,
53                    med_entity_type entity);
54   private:
55     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _conn;
56     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _conn_index;
57     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num;
58     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam;
59     INTERP_KERNEL::NormalizedCellType _type;
60     med_entity_type _entity;
61   };
62 }
63
64 #endif