Salome HOME
Copyright update 2020
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingNormalizedUnstructuredMesh.hxx
1 // Copyright (C) 2007-2020  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, or (at your option) any later version.
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 // Author : Anthony Geay (CEA/DEN)
20
21 #ifndef __PARAMEDMEM_MEDCOUPLINGNORMALIZEDUNSTRUCTUREDMESH_HXX__
22 #define __PARAMEDMEM_MEDCOUPLINGNORMALIZEDUNSTRUCTUREDMESH_HXX__
23
24 #include "NormalizedUnstructuredMesh.hxx"
25 #include "MCType.hxx"
26
27 namespace MEDCoupling
28 {
29   class MEDCouplingPointSet;
30 }
31
32 template<int SPACEDIM,int MESHDIM>
33 class MEDCouplingNormalizedUnstructuredMesh
34 {
35 public:
36   static const int MY_SPACEDIM=SPACEDIM;
37   static const int MY_MESHDIM=MESHDIM;
38   typedef mcIdType MyConnType;
39   static const INTERP_KERNEL::NumberingPolicy My_numPol=INTERP_KERNEL::ALL_C_MODE;
40 public:
41   MEDCouplingNormalizedUnstructuredMesh(const MEDCoupling::MEDCouplingPointSet *mesh);
42   void getBoundingBox(double *boundingBox) const;
43   INTERP_KERNEL::NormalizedCellType getTypeOfElement(mcIdType eltId) const;
44   mcIdType getNumberOfNodesOfElement(mcIdType eltId) const;
45   mcIdType getNumberOfElements() const;
46   mcIdType getNumberOfNodes() const;
47   const mcIdType *getConnectivityPtr() const;
48   const double *getCoordinatesPtr() const;
49   const mcIdType *getConnectivityIndexPtr() const;
50   void releaseTempArrays();
51   ~MEDCouplingNormalizedUnstructuredMesh();
52 private:
53   void prepare();
54 private:
55   const MEDCoupling::MEDCouplingPointSet *_mesh;
56   mcIdType *_conn_for_interp;
57   mcIdType *_conn_index_for_interp;
58 };
59
60 #endif