]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDLoader/MEDFileMeshSupport.cxx
Salome HOME
b7ff2ab561524754a565cfc3959aac5c16e88a92
[tools/medcoupling.git] / src / MEDLoader / MEDFileMeshSupport.cxx
1 // Copyright (C) 2007-2017  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 (EDF R&D)
20
21 #include "MEDFileMeshSupport.hxx"
22
23 #include "MEDLoaderBase.hxx"
24 #include "MEDFileSafeCaller.txx"
25
26 #include "InterpKernelAutoPtr.hxx"
27
28 using namespace MEDCoupling;
29
30 MEDFileMeshSupport *MEDFileMeshSupport::New()
31 {
32   return new MEDFileMeshSupport;
33 }
34
35 MEDFileMeshSupport *MEDFileMeshSupport::New(const std::string& fileName, int smid)
36 {
37   MEDFileUtilities::AutoFid fid(OpenMEDFileForRead(fileName));
38   return New(fid,smid);
39 }
40
41 MEDFileMeshSupport *MEDFileMeshSupport::New(med_idt fid, int smid)
42 {
43   return new MEDFileMeshSupport(fid,smid);
44 }
45
46 std::vector<const BigMemoryObject *> MEDFileMeshSupport::getDirectChildrenWithNull() const
47 {
48   return std::vector<const BigMemoryObject *>();
49 }
50
51 std::size_t MEDFileMeshSupport::getHeapMemorySizeWithoutChildren() const
52 {
53   return 0;
54 }
55
56 int MEDFileMeshSupport::getSpaceDim() const
57 {
58   return _space_dim;
59 }
60
61 void MEDFileMeshSupport::setSpaceDim(int dim)
62 {
63   _space_dim=dim;
64 }
65
66 int MEDFileMeshSupport::getMeshDim() const
67 {
68   return _mesh_dim;
69 }
70
71 void MEDFileMeshSupport::setMeshDim(int dim)
72 {
73   _mesh_dim=dim;
74 }
75
76 void MEDFileMeshSupport::writeLL(med_idt fid) const
77 {
78 }
79
80 MEDFileMeshSupport::MEDFileMeshSupport(med_idt fid, int smid)
81 {
82   INTERP_KERNEL::AutoPtr<char> msn(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
83   INTERP_KERNEL::AutoPtr<char> description(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
84   med_axis_type axType;
85   int nAxis(MEDsupportMeshnAxis(fid,smid));
86   INTERP_KERNEL::AutoPtr<char> axisName(new char[MED_SNAME_SIZE*nAxis+1]),axisUnit(new char[MED_SNAME_SIZE*nAxis+1]);
87   MEDFILESAFECALLERRD0(MEDsupportMeshInfo,(fid,smid,msn,&_space_dim,&_mesh_dim,description,&axType,axisName,axisUnit));
88 }
89
90 MEDFileMeshSupport::MEDFileMeshSupport():_space_dim(-1),_mesh_dim(-1)
91 {
92 }