1 // Copyright (C) 2007-2017 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
21 #include "MEDFileMeshSupport.hxx"
23 #include "MEDLoaderBase.hxx"
24 #include "MEDFileSafeCaller.txx"
26 #include "InterpKernelAutoPtr.hxx"
28 using namespace MEDCoupling;
30 MEDFileMeshSupport *MEDFileMeshSupport::New()
32 return new MEDFileMeshSupport;
35 MEDFileMeshSupport *MEDFileMeshSupport::New(const std::string& fileName, int smid)
37 MEDFileUtilities::AutoFid fid(OpenMEDFileForRead(fileName));
41 MEDFileMeshSupport *MEDFileMeshSupport::New(med_idt fid, int smid)
43 return new MEDFileMeshSupport(fid,smid);
46 std::vector<const BigMemoryObject *> MEDFileMeshSupport::getDirectChildrenWithNull() const
48 return std::vector<const BigMemoryObject *>();
51 std::size_t MEDFileMeshSupport::getHeapMemorySizeWithoutChildren() const
56 int MEDFileMeshSupport::getSpaceDim() const
61 void MEDFileMeshSupport::setSpaceDim(int dim)
66 int MEDFileMeshSupport::getMeshDim() const
71 void MEDFileMeshSupport::setMeshDim(int dim)
76 void MEDFileMeshSupport::writeLL(med_idt fid) const
80 MEDFileMeshSupport::MEDFileMeshSupport(med_idt fid, int smid)
82 INTERP_KERNEL::AutoPtr<char> msn(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
83 INTERP_KERNEL::AutoPtr<char> description(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
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));
90 MEDFileMeshSupport::MEDFileMeshSupport():_space_dim(-1),_mesh_dim(-1)